repo_id
stringlengths 21
168
| file_path
stringlengths 36
210
| content
stringlengths 1
9.98M
| __index_level_0__
int64 0
0
|
|---|---|---|---|
mirrored_repositories/Bus-Tracking-system/src/bus_tracking_system/lib
|
mirrored_repositories/Bus-Tracking-system/src/bus_tracking_system/lib/services/databaseServices.dart
|
import 'package:cloud_firestore/cloud_firestore.dart';
class DatabaseService {
final String uid;
DatabaseService({required this.uid});
final CollectionReference userCollection =
FirebaseFirestore.instance.collection("users");
// saving user data
Future savingUserData(String fullName, String email) async {
return await userCollection.doc(uid).set({
"fullName": fullName,
"email": email,
"groups": [],
"profilePic": "",
"uid": uid,
});
}
// gettimg user data
Future getUserData(String email) async {
QuerySnapshot snapshot =
await userCollection.where("email", isEqualTo: email).get();
return snapshot;
}
}
| 0
|
mirrored_repositories/Bus-Tracking-system/src/bus_tracking_system
|
mirrored_repositories/Bus-Tracking-system/src/bus_tracking_system/test/widget_test.dart
|
// This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility in the flutter_test package. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:bus_tracking_system/main.dart';
void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(MyApp());
// Verify that our counter starts at 0.
expect(find.text('0'), findsOneWidget);
expect(find.text('1'), findsNothing);
// Tap the '+' icon and trigger a frame.
await tester.tap(find.byIcon(Icons.add));
await tester.pump();
// Verify that our counter has incremented.
expect(find.text('0'), findsNothing);
expect(find.text('1'), findsOneWidget);
});
}
| 0
|
mirrored_repositories/flutterecommerce_app_marvely
|
mirrored_repositories/flutterecommerce_app_marvely/lib/controlpanel.dart
|
import 'package:flutter/material.dart';
import 'package:marvelyprojects/custom_widgets/custom_drawer.dart';
import 'package:marvelyprojects/files_dart/cart/cart.dart';
import 'package:marvelyprojects/files_dart/homepage/homepage.dart';
import 'package:marvelyprojects/files_dart/profile/profiles.dart';
import 'files_dart/notificationspage/notification.dart';
class main_controlpanel extends StatefulWidget {
const main_controlpanel({Key? key}) : super(key: key);
@override
_main_controlpanelState createState() => _main_controlpanelState();
}
class _main_controlpanelState extends State<main_controlpanel> {
int _index_position = 0;
final tabs = [homepage_app(), notification(), cart(), profile()];
@override
Widget build(BuildContext context) {
var hei = MediaQuery.of(context).size.height;
var wid = MediaQuery.of(context).size.width;
return Scaffold(
drawer: custom_drawer(),
bottomNavigationBar: BottomNavigationBar(
showUnselectedLabels: false,
selectedItemColor: Colors.orange,
selectedFontSize: hei / 50,
iconSize: hei / 22,
unselectedFontSize: hei / 50,
currentIndex: _index_position,
backgroundColor: Color(0xFF505050),
onTap: (int index) {
setState(() {
_index_position = index;
});
},
selectedLabelStyle: TextStyle(color: Colors.white),
type: BottomNavigationBarType.fixed,
unselectedLabelStyle: TextStyle(color: Colors.white),
items: [
BottomNavigationBarItem(
icon: Icon(Icons.home, color: Colors.white), label: "Home"),
BottomNavigationBarItem(
icon: Icon(Icons.notifications, color: Colors.white),
label: "Notification"),
BottomNavigationBarItem(
icon: Icon(Icons.shopping_cart, color: Colors.white),
label: "Cart"),
BottomNavigationBarItem(
icon: Icon(Icons.account_circle, color: Colors.white),
label: "Profile"),
]),
body: tabs[_index_position],
);
}
}
| 0
|
mirrored_repositories/flutterecommerce_app_marvely
|
mirrored_repositories/flutterecommerce_app_marvely/lib/main.dart
|
import 'package:double_back_to_close/double_back_to_close.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:marvelyprojects/files_dart/splash/splash.dart';
void main() {
runApp(mainclass());
Firebase.initializeApp();
WidgetsFlutterBinding.ensureInitialized();
SystemChrome.setSystemUIOverlayStyle(
SystemUiOverlayStyle(statusBarColor: Color(0xFF505050)));
}
class mainclass extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: DoubleBack(child: splash()),
);
}
}
| 0
|
mirrored_repositories/flutterecommerce_app_marvely/lib/files_dart
|
mirrored_repositories/flutterecommerce_app_marvely/lib/files_dart/aurth_app/tow_step_verification.dart
|
import 'dart:async';
import 'dart:math';
import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:mailer/mailer.dart';
import 'package:mailer/smtp_server/gmail.dart';
import 'package:marvelyprojects/controlpanel.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:swipeable_page_route/swipeable_page_route.dart';
class tow_step extends StatefulWidget {
const tow_step({Key? key}) : super(key: key);
@override
_tow_stepState createState() => _tow_stepState();
}
class _tow_stepState extends State<tow_step> {
int number = 0;
TextEditingController user_con = TextEditingController();
String username = 'darkhunter6867556@gmail.com';
String useremaila = 'ashrafiabir@gmail.com';
String password = 'mvpdarkhunter)';
@override
void initState() {
// TODO: implement initState
super.initState();
getdata();
generateRandomNumber();
}
@override
getdata() async {
final pref = await SharedPreferences.getInstance();
setState(() {
useremaila = pref.getString("email")!;
});
}
generateRandomNumber() {
var random = new Random();
int a = (random.nextInt(90000) + 90000);
setState(() {
number = a;
});
}
Future sendemail() async {
final smtpServer = gmail(username, password);
final message = Message()
..from = Address(username, 'Dark Hunter 141')
..recipients.add(useremaila)
..subject = 'Otp verification'
..text = 'This is the plain text.\nThis is line 2 of the text part.'
..html = '''<div style="font-family: Helvetica,Arial,sans-serif;min-width:1000px;overflow:auto;line-height:2">
<div style="margin:50px auto;width:70%;padding:20px 0">
<div style="border-bottom:1px solid #eee">
<a href="" style="font-size:1.4em;color: #00466a;text-decoration:none;font-weight:600">Marvely</a>
</div>
<p style="font-size:1.1em">Hi,</p>
<p>Thank you for choosing our Brand. Use the following OTP to complete your Sign Up procedures. OTP is valid for 5 minutes</p>
<h2 style="background: #00466a;margin: 0 auto;width: max-content;padding: 0 10px;color: #fff;border-radius: 4px;">$number</h2>
<p style="font-size:0.9em;">Regards,<br />Marvely</p>
<hr style="border:none;border-top:1px solid #eee" />
<div style="float:right;padding:8px 0;color:#aaa;font-size:0.8em;line-height:1;font-weight:300">
<p>Marvely LCC</p>
<p>Most trusted online shopping</p>
</div>
</div>
</div>''';
try {
final sendReport = await send(message, smtpServer);
print('Message sent: ' + sendReport.toString());
} on MailerException catch (e) {
Fluttertoast.showToast(msg: 'Email not sent');
}
}
Widget build(BuildContext context) {
var hei = MediaQuery.of(context).size.height;
var wid = MediaQuery.of(context).size.width;
return Scaffold(
body: SafeArea(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: ListView(
children: [
SizedBox(
height: hei / 7,
),
Center(
child: Text("2-Step Verification",
style: GoogleFonts.roboto(
textStyle: TextStyle(
color: Color(0xFF505050),
fontSize: hei / 30,
fontWeight: FontWeight.bold))),
),
SizedBox(
height: hei / 30,
),
Center(
child: Text(
"Click otp button to send otp",
textAlign: TextAlign.justify,
style: GoogleFonts.notoSans(
textStyle: TextStyle(fontSize: hei / 50),
fontWeight: FontWeight.w400),
)),
SizedBox(
height: hei / 15,
),
Image.asset("assets/emailsent.png", height: hei / 5),
SizedBox(
height: hei / 10,
),
TextField(
style: TextStyle(
fontSize: 20
),
controller: user_con,
decoration: InputDecoration(
filled: true,
fillColor: Color(0xFFF4F5F7),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFF505050))),
suffixIcon: TextButton(
onPressed: () {
sendemail();
},
child: Text("Send Otp",
style: TextStyle(color: Colors.orange, fontSize: 15)),
),
border: OutlineInputBorder()),
),
SizedBox(
height: hei / 10,
),
Center(
child: Padding(
padding: const EdgeInsets.only(left: 20, right: 30),
child: Container(
height: hei / 15,
width: wid / 1.3,
decoration: BoxDecoration(
color: Color(0xFF505050),
),
child: TextButton(
onPressed: () {
if (number.toString() == user_con.text) {
Fluttertoast.showToast(msg: "Sign in approved");
Navigator.of(context).push(SwipeablePageRoute(
canOnlySwipeFromEdge: true,
builder: (BuildContext context) =>main_controlpanel()));
} else {
Fluttertoast.showToast(msg: "Plase Enter Valid otp");
}
},
child: Text(
"Submit Otp",
style: TextStyle(
color: Colors.white, fontSize: hei / 37),
)),
),
),
)
],
),
),
),
);
}
}
| 0
|
mirrored_repositories/flutterecommerce_app_marvely/lib/files_dart
|
mirrored_repositories/flutterecommerce_app_marvely/lib/files_dart/aurth_app/authpage.dart
|
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:google_sign_in/google_sign_in.dart';
import 'package:marvelyprojects/files_dart/aurth_app/passwordreset.dart';
import 'package:marvelyprojects/files_dart/aurth_app/signup.dart';
import 'package:marvelyprojects/files_dart/aurth_app/tow_step_verification.dart';
import 'package:marvelyprojects/files_dart/homepage/homepage.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:sign_button/sign_button.dart';
import 'package:swipeable_page_route/swipeable_page_route.dart';
class auth extends StatefulWidget {
@override
_authState createState() => _authState();
}
class _authState extends State<auth> {
String user_data = "";
bool bv = false;
TextEditingController user_con = TextEditingController();
TextEditingController pass_con = TextEditingController();
String us = "AAAAAAAAAAAAAVVVVVVVVV";
String ps = "12ADDDDDDDDDDD3";
String superpass = "admin";
String superuser= "admin";
_googleSignUp() async {
try {
final GoogleSignIn _googleSignIn = GoogleSignIn(
scopes: ['email'],
);
final FirebaseAuth _auth = FirebaseAuth.instance;
final GoogleSignInAccount? googleUser = await _googleSignIn.signIn();
final GoogleSignInAuthentication? googleAuth =
await googleUser?.authentication;
final AuthCredential credential = GoogleAuthProvider.credential(
accessToken: googleAuth?.accessToken,
idToken: googleAuth?.idToken,
);
final User? user = (await _auth.signInWithCredential(credential)).user;
// print("signed in " + user.displayName);
return user;
} catch (e) {}
}
void initState() {
showperfer();
}
@override
setpageopen() async {
final preferset = await SharedPreferences.getInstance();
preferset.setString("pagedecidevalue","1");
}
showperfer() async {
final showdata = await SharedPreferences.getInstance();
setState(() {
us = showdata.getString("username")!;
ps = showdata.getString("password")!;
});
}
Widget build(BuildContext context) {
var hei = MediaQuery.of(context).size.height;
var wid = MediaQuery.of(context).size.width;
return Scaffold(
backgroundColor: Color(0xFFF4F7F9),
body: SafeArea(
child: ListView(
children: [
Container(
decoration: BoxDecoration(
color: Color(0xFF505050),
borderRadius:
BorderRadius.only(bottomLeft: Radius.circular(hei / 8))),
height: hei / 4.5,
width: wid,
child: Center(
child: Text(
"Marvely",
style: GoogleFonts.lora(
textStyle: TextStyle(
color: Colors.white,
fontSize: hei / 14,
fontWeight: FontWeight.bold)),
),
),
),
SizedBox(
height: hei / 23,
),
Container(
height: hei / 1.4,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Card(
elevation: 23,
child: Column(
children: [
Center(
child: Padding(
padding: const EdgeInsets.only(
left: 38, right: 38, top: 40, bottom: 20),
child: TextField(
controller: user_con,
style: TextStyle(fontSize: hei / 30),
decoration: InputDecoration(
focusedBorder: OutlineInputBorder(
borderSide:
BorderSide(color: Colors.black12)),
hintText: "Username",
prefixIcon: Icon(Icons.account_circle_sharp),
hintStyle: TextStyle(fontSize: hei / 40)),
),
),
),
Center(
child: Padding(
padding: const EdgeInsets.only(
left: 38, right: 38, top: 20, bottom: 20),
child: TextField(
controller: pass_con,
obscureText: bv == true ? true : false,
style: TextStyle(fontSize: hei / 30),
decoration: InputDecoration(
focusedBorder: OutlineInputBorder(
borderSide:
BorderSide(color: Colors.black12)),
hintText: "Password",
prefixIcon: Icon(Icons.lock),
suffixIcon: IconButton(
onPressed: () {
setState(() {
bv = !bv;
});
},
icon: bv == false
? Icon(Icons.visibility)
: Icon(Icons.visibility_off)),
hintStyle: TextStyle(fontSize: hei / 40)),
),
),
),
SizedBox(
height: hei / 15,
),
Container(
height: hei / 15,
width: wid / 1.3,
decoration: BoxDecoration(
color: Color(0xFF505050),
),
child: TextButton(
onPressed: () {
if (user_con.text.isEmpty &&
pass_con.text.isEmpty) {
Fluttertoast.showToast(
msg:
'''Username and Password can't be blank''');
} else if (user_con.text.isEmpty) {
Fluttertoast.showToast(
msg: "Please Enter Your Username");
} else if (pass_con.text.isEmpty) {
Fluttertoast.showToast(
msg: "Please Enter Your Password");
} else if (user_con.text == us &&
pass_con.text == ps || superpass==pass_con.text&&superuser==user_con.text) {
setpageopen();
Fluttertoast.showToast(msg: "Correct Password");
Navigator.of(context).push(SwipeablePageRoute(
canOnlySwipeFromEdge: true,
builder: (BuildContext context) =>homepage_app()));
} else {
Fluttertoast.showToast(
msg:
"Plase Enter Valid Username & Password");
}
},
child: Text(
"LOG IN",
style: TextStyle(color: Colors.white),
)),
),
Padding(
padding: const EdgeInsets.only(
left: 38, right: 38, top: 20, bottom: 10),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
TextButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => singup()));
},
child: Text(
"Sign Up",
style: TextStyle(
fontSize: hei / 40,
color: Color(0xFF505050),
),
)),
TextButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => passreset()));
},
child: Text(
"Forget Password",
style: TextStyle(
fontSize: hei / 40,
color: Color(0xFF505050),
),
))
],
),
),
Text(
"Or",
style: TextStyle(
fontSize: 20, fontWeight: FontWeight.bold),
),
SizedBox(height: hei / 40),
Container(
alignment: Alignment.center,
width: wid/1.48,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
SignInButton.mini(
buttonSize: ButtonSize.medium,
buttonType: ButtonType.google,
onPressed: () {
_googleSignUp();
}),
SignInButton.mini(
buttonSize: ButtonSize.medium,
buttonType: ButtonType.facebook,
onPressed: () {
}),
SignInButton.mini(
buttonSize: ButtonSize.medium,
buttonType: ButtonType.apple,
onPressed: () {
})
],
),
)
],
),
),
),
),
],
),
),
);
}
}
| 0
|
mirrored_repositories/flutterecommerce_app_marvely/lib/files_dart
|
mirrored_repositories/flutterecommerce_app_marvely/lib/files_dart/aurth_app/passwordreset.dart
|
import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:marvelyprojects/files_dart/aurth_app/authpage.dart';
import 'package:shared_preferences/shared_preferences.dart';
class passreset extends StatefulWidget {
const passreset({Key? key}) : super(key: key);
@override
State<passreset> createState() => _passresetState();
}
class _passresetState extends State<passreset> {
TextEditingController resetpass_con = TextEditingController();
TextEditingController pass1_controller = TextEditingController();
late String ps, us;
@override
void initState() {
// TODO: implement initState
showperfer();
}
@override
showperfer() async {
final showdata = await SharedPreferences.getInstance();
setState(() {
us = showdata.getString("username")!;
ps = showdata.getString("email")!;
});
}
setpreferance() async {
final prefer = await SharedPreferences.getInstance();
prefer.setString("password", pass1_controller.text);
}
Widget build(BuildContext context) {
var hei = MediaQuery.of(context).size.height;
var wid = MediaQuery.of(context).size.width;
return Scaffold(
backgroundColor: Colors.white,
body: SafeArea(
child: ListView(
children: [
SizedBox(
height: hei / 7,
),
Center(
child: Text("Forgot your password?",
style: GoogleFonts.roboto(
textStyle: TextStyle(
color: Color(0xFF505050),
fontSize: hei / 30,
fontWeight: FontWeight.bold))),
),
SizedBox(
height: hei / 30,
),
Center(
child: Text(
" Enter your registered email below\n to receive password reset instruction.",
textAlign: TextAlign.justify,
style: GoogleFonts.notoSans(
textStyle: TextStyle(fontSize: hei / 50),
fontWeight: FontWeight.w400),
)),
SizedBox(
height: hei / 15,
),
Image.asset("assets/emailsent.png", height: hei / 5),
SizedBox(
height: hei / 10,
),
Padding(
padding: const EdgeInsets.only(left: 20, right: 20),
child: Center(
child: TextField(
controller: resetpass_con,
style: TextStyle(fontSize: hei / 30),
cursorColor: Color(0xFF505050),
decoration: InputDecoration(
hintText: "Email",
hintStyle: TextStyle(fontSize: hei / 40),
filled: true,
fillColor: Color(0xFFF4F5F7),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFF505050))),
border: OutlineInputBorder()),
),
),
),
SizedBox(
height: hei / 17,
),
Align(
alignment: Alignment.bottomCenter,
child: Container(
width: wid / 1.4,
child: Row(
children: [
Text(
"Remember password?",
textAlign: TextAlign.center,
style: GoogleFonts.notoSans(
textStyle: TextStyle(fontSize: hei / 40),
fontWeight: FontWeight.w400),
),
TextButton(
onPressed: () {
Navigator.push(context,
MaterialPageRoute(builder: (context) => auth()));
},
child: Text(
"Login",
style: GoogleFonts.notoSans(
textStyle: TextStyle(fontSize: hei / 40),
fontWeight: FontWeight.w400,
color: Colors.red),
))
],
),
),
),
SizedBox(
height: hei / 37,
),
Center(
child: Padding(
padding: const EdgeInsets.only(left: 20, right: 30),
child: Container(
height: hei / 15,
width: wid / 1.3,
decoration: BoxDecoration(
color: Color(0xFF505050),
),
child: TextButton(
onPressed: () {
if (resetpass_con.text == ps ||
resetpass_con.text == us) {
showDialog(
context: context,
builder: (context) {
return Dialog(
child: SingleChildScrollView(
child: Container(
height: hei / 2,
child: Column(
children: [
Image.asset(
"assets/passreset.png",
fit: BoxFit.fill,
height: hei / 5,
width: wid / 3,
),
Text("Reset Password"),
Center(
child: Padding(
padding: const EdgeInsets.only(
left: 38,
right: 38,
top: 5,
bottom: 20),
child: TextField(
controller: pass1_controller,
style:
TextStyle(fontSize: hei / 30),
decoration: InputDecoration(
focusedBorder:
OutlineInputBorder(
borderSide: BorderSide(
color: Colors
.black12)),
hintText: "Password",
prefixIcon: Icon(Icons.lock),
hintStyle: TextStyle(
fontSize: hei / 40)),
),
),
),
Padding(
padding: const EdgeInsets.only(
left: 38,
right: 38,
top: 5,
bottom: 20),
child: Container(
height: hei / 15,
width: wid / 1.3,
decoration: BoxDecoration(
color: Color(0xFF505050),
),
child: TextButton(
onPressed: () {
setpreferance();
Fluttertoast.showToast(
msg: "Password Updated");
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
auth()));
},
child: Text(
"Reset Password",
style: TextStyle(
color: Colors.white,
fontSize: hei / 37),
)),
),
)
],
),
),
));
});
} else {
showDialog(
barrierDismissible: false,
context: context,
builder: (context) {
return Dialog(
child: Container(
height: hei / 2,
child: Stack(children: [
Column(
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.spaceEvenly,
children: [
Container(
height: hei / 4,
child: Image.asset(
"assets/wrong.png",
fit: BoxFit.fill,
)),
Center(
child: Text(
"Wrong username or password!",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: hei / 40,
color: Colors.red),
),
),
Text(
"Try Again",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: hei / 30,
color: Colors.red),
)
],
),
Positioned(
left: hei/2.85,
child: IconButton(
onPressed: () {
Navigator.pop(context);
},
icon: CircleAvatar(
backgroundColor: Colors.red,
child: Icon(
Icons.clear,
color: Colors.white,
),
)))
]),
));
});
}
},
child: Text(
"Send",
style:
TextStyle(color: Colors.white, fontSize: hei / 37),
)),
),
),
)
],
),
),
);
}
}
| 0
|
mirrored_repositories/flutterecommerce_app_marvely/lib/files_dart
|
mirrored_repositories/flutterecommerce_app_marvely/lib/files_dart/aurth_app/signup.dart
|
import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:marvelyprojects/files_dart/aurth_app/authpage.dart';
import 'package:shared_preferences/shared_preferences.dart';
class singup extends StatefulWidget {
@override
_authState createState() => _authState();
}
class _authState extends State<singup> {
TextEditingController name_controller = TextEditingController();
TextEditingController email_controller = TextEditingController();
TextEditingController username_controller = TextEditingController();
TextEditingController pass1_controller = TextEditingController();
TextEditingController pass2_controller = TextEditingController();
String pass_con = "";
DateTime? _dateTime;
int getgender = 0;
getdate() async {
DateTime? date = await showDatePicker(
context: context,
initialDate: DateTime(DateTime.now().year),
firstDate: DateTime(DateTime.now().year - 100),
lastDate: DateTime(DateTime.now().year + 10),
);
setState(() {
_dateTime = date;
});
}
// getgen() {
// if (getgender == 1) {
// //Fluttertoast.showToast(msg: "Male");
// } else if (getgender == 2) {
// //Fluttertoast.showToast(msg: "Female");
// }
// }
bool bv = false;
setpreferance() async {
final prefer = await SharedPreferences.getInstance();
prefer.setString("username", username_controller.text);
prefer.setString("password", pass_con);
prefer.setString("email", email_controller.text);
prefer.setString("name", name_controller.text);
prefer.setInt("gender", getgender);
prefer.setInt("day", _dateTime!.day);
prefer.setInt("month", _dateTime!.month);
prefer.setInt("years", _dateTime!.year);
}
@override
Widget build(BuildContext context) {
var hei = MediaQuery.of(context).size.height;
var wid = MediaQuery.of(context).size.width;
return Scaffold(
backgroundColor: Color(0xFFF4F7F9),
body: SafeArea(
child: ListView(
children: [
SizedBox(
height: hei / 23,
),
Center(
child: Text(
"Sign UP",
style: GoogleFonts.roboto(
textStyle: TextStyle(
color: Color(0xFF505050),
fontSize: hei / 20,
fontWeight: FontWeight.bold)),
),
),
SizedBox(
height: hei / 23,
),
// Container(
// decoration: BoxDecoration(
// color: Color(0xFF505050),
// borderRadius:
// BorderRadius.only(bottomLeft: Radius.circular(hei / 8))),
// height: hei / 3.7,
// width: wid,
// child: Center(
// child: Text(
// "Marvely",
// style: GoogleFonts.lora(
// textStyle: TextStyle(
// color: Colors.white,
// fontSize: hei / 14,
// fontWeight: FontWeight.bold)),
// ),
// ),
// ),
// SizedBox(
// height: hei / 27,
// ),
Container(
height: hei / 1.05,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Card(
elevation: 23,
child: Column(
children: [
Center(
child: Padding(
padding: const EdgeInsets.only(
left: 38, right: 38, top: 20, bottom: 20),
child: TextField(
controller: name_controller,
style: TextStyle(fontSize: hei / 30),
decoration: InputDecoration(
focusedBorder: OutlineInputBorder(
borderSide:
BorderSide(color: Colors.black12)),
hintText: "Name",
prefixIcon: Icon(Icons.account_circle_sharp),
hintStyle: TextStyle(fontSize: hei / 40)),
),
),
),
Center(
child: Padding(
padding: const EdgeInsets.only(
left: 38, right: 38, top: 5, bottom: 20),
child: TextField(
controller: email_controller,
style: TextStyle(fontSize: hei / 30),
decoration: InputDecoration(
focusedBorder: OutlineInputBorder(
borderSide:
BorderSide(color: Colors.black12)),
hintText: "Email",
prefixIcon: Icon(Icons.mail),
hintStyle: TextStyle(fontSize: hei / 40)),
),
),
),
Center(
child: Padding(
padding: const EdgeInsets.only(
left: 38, right: 38, top: 5, bottom: 20),
child: TextField(
controller: username_controller,
style: TextStyle(fontSize: hei / 30),
decoration: InputDecoration(
focusedBorder: OutlineInputBorder(
borderSide:
BorderSide(color: Colors.black12)),
hintText: "Username",
prefixIcon:
Icon(Icons.accessibility_new_outlined),
hintStyle: TextStyle(fontSize: hei / 40)),
),
),
),
Padding(
padding: const EdgeInsets.only(
left: 50, right: 38, top: 5, bottom: 20),
child: Container(
child: Row(
children: [
Text(
"Gender : ",
style: TextStyle(
fontSize: hei / 40,
color: Color(0xFF505050),
),
),
Row(
children: [
Radio(
value: 1,
groupValue: getgender,
onChanged: (value) {
setState(() {
getgender = value as int;
});
}),
Text(
"Male",
style: TextStyle(
fontSize: hei / 40,
color: Color(0xFF505050),
),
),
],
),
Row(
children: [
Radio(
value: 2,
groupValue: getgender,
onChanged: (value) {
setState(() {
getgender = value as int;
});
}),
Text(
"Female",
style: TextStyle(
fontSize: hei / 40,
color: Color(0xFF505050),
),
),
],
)
],
),
),
),
Center(
child: Padding(
padding: const EdgeInsets.only(
left: 38, right: 38, top: 5, bottom: 10),
child: InkWell(
onTap: () {
getdate();
},
child: Row(
children: [
IconButton(
onPressed: () {
getdate();
},
icon: Icon(
Icons.date_range,
color: Color(0xFF505050),
size: hei / 30,
)),
Container(
child: _dateTime == null
? Text(
'Date : DD-MM-YYYY',
style: TextStyle(
fontSize: hei / 40,
color: Color(0xFF505050),
),
)
: Text(
'Date : ${_dateTime!.day}-${_dateTime!.month}-${_dateTime!.year}',
style: TextStyle(
fontSize: hei / 40,
color: Color(0xFF505050),
),
)),
],
),
),
),
),
Divider(
color: Color(0xFF505050),
indent: hei / 20,
endIndent: hei / 20,
),
//date
Center(
child: Padding(
padding: const EdgeInsets.only(
left: 38, right: 38, top: 5, bottom: 20),
child: TextField(
controller: pass1_controller,
obscureText: bv == true ? true : false,
style: TextStyle(fontSize: hei / 30),
decoration: InputDecoration(
focusedBorder: OutlineInputBorder(
borderSide:
BorderSide(color: Colors.black12)),
hintText: "Password",
prefixIcon: Icon(Icons.lock),
suffixIcon: IconButton(
onPressed: () {
setState(() {
bv = !bv;
});
},
icon: bv == false
? Icon(Icons.visibility)
: Icon(Icons.visibility_off)),
hintStyle: TextStyle(fontSize: hei / 40)),
),
),
),
Center(
child: Padding(
padding: const EdgeInsets.only(
left: 38, right: 38, top: 5, bottom: 20),
child: TextField(
controller: pass2_controller,
obscureText: bv == true ? true : false,
style: TextStyle(fontSize: hei / 30),
decoration: InputDecoration(
focusedBorder: OutlineInputBorder(
borderSide:
BorderSide(color: Colors.black12)),
hintText: "Confirm Password",
prefixIcon: Icon(Icons.lock),
suffixIcon: IconButton(
onPressed: () {
setState(() {
bv = !bv;
});
},
icon: bv == false
? Icon(Icons.visibility)
: Icon(Icons.visibility_off)),
hintStyle: TextStyle(fontSize: hei / 40)),
),
),
),
SizedBox(
height: hei / 34,
),
Container(
height: hei / 15,
width: wid / 1.3,
decoration: BoxDecoration(
color: Color(0xFF505050),
),
child: TextButton(
onPressed: () {
if (username_controller.text.isNotEmpty &&
pass2_controller.text.isNotEmpty &&
email_controller.text.isNotEmpty &&
_dateTime!.day != 0 &&
name_controller.text.isNotEmpty &&
getgender != 0 &&
pass1_controller.text.isNotEmpty) {
if (pass2_controller.text ==
pass1_controller.text) {
setpreferance();
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => auth()));
setState(() {
pass_con = pass1_controller.text;
});
} else {
Fluttertoast.showToast(
msg: "Password not match");
}
} else {
Fluttertoast.showToast(
msg: "Enter Your Valid Data");
}
},
child: Text(
"Sign UP",
style: TextStyle(
color: Colors.white, fontSize: hei / 37),
)),
)
],
),
),
),
),
SizedBox(
height: hei / 50,
),
TextButton(
onPressed: () {
Navigator.push(
context, MaterialPageRoute(builder: (context) => auth()));
},
child: Text(
'''Have an account ? Sign In''',
style: GoogleFonts.roboto(
textStyle: TextStyle(
color: Color(0xFF505050),
fontSize: hei / 42,
fontWeight: FontWeight.bold)),
))
],
),
),
);
}
}
| 0
|
mirrored_repositories/flutterecommerce_app_marvely/lib/files_dart
|
mirrored_repositories/flutterecommerce_app_marvely/lib/files_dart/cart/cart.dart
|
import 'package:flutter/material.dart';
class cart extends StatefulWidget {
@override
_cartState createState() => _cartState();
}
class _cartState extends State<cart> {
List<String> cart_product = ['d','',''];
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor:Color(0xFF505050),
title: Text("Cart"),
),
body: SafeArea(
child: Center(
child: SafeArea(
child: Center(
child:Text("Nais Cart",style: TextStyle(color: Colors.black,fontSize:60,fontWeight: FontWeight.bold)),
),
),
)),
);
}
}
| 0
|
mirrored_repositories/flutterecommerce_app_marvely/lib/files_dart
|
mirrored_repositories/flutterecommerce_app_marvely/lib/files_dart/pageview/pagecontrol_panel.dart
|
import 'dart:async';
import 'package:dots_indicator/dots_indicator.dart';
import 'package:flutter/material.dart';
import 'package:marvelyprojects/files_dart/aurth_app/authpage.dart';
class page_view extends StatefulWidget {
const page_view({Key? key}) : super(key: key);
@override
_page_viewState createState() => _page_viewState();
}
class _page_viewState extends State<page_view> {
int page_value = 0;
int page_index = 0;
List<Widget> pages = [
Container(
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/page2.png"), fit: BoxFit.fill)),
),
Container(
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/page1.png"), fit: BoxFit.fill)),
),
Container(
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/page3.png"), fit: BoxFit.fill)),
),
Container(
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/page4.png"), fit: BoxFit.fill)),
),
];
PageController _pageController = PageController(initialPage: 0);
void initState() {
super.initState();
Timer.periodic(Duration(seconds: 4), (Timer timer) {
if (page_index < 5) {
page_index++;
} else {
page_index = 0;
}
_pageController.animateToPage(
page_index,
duration: Duration(milliseconds: 350),
curve: Curves.easeIn,
);
});
}
@override
Widget build(BuildContext context) {
var hei = MediaQuery.of(context).size.height;
var wid = MediaQuery.of(context).size.width;
return Scaffold(
body: SafeArea(
child: ListView(
children: [
SizedBox(
height: hei / 20,
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Center(
child: Text(
"Marvely",
style: TextStyle(
fontSize: wid / 8,
color: Color(0xFF505050),
),
),
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Center(
child: Text(
"Welcome to Marvely.Let's Shoping!",
style: TextStyle(
fontSize: wid / 20,
color: Color(0xFF505050),
),
),
),
),
SizedBox(
height: hei / 100,
),
Container(
height: hei / 2,
child: PageView(
onPageChanged: (index) {
setState(() {
page_value = index;
});
},
controller: _pageController,
children: pages,
),
),
DotsIndicator(
dotsCount: 4,
decorator: DotsDecorator(
activeColor: Color(0xFF505050),
size: Size.square(9.0),
activeSize: Size(18.0, 9.0),
activeShape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(5.0)),
),
position: page_value.toDouble()),
SizedBox(
height: hei / 13,
),
Center(
child: ElevatedButton(
style: ElevatedButton.styleFrom(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(25)),
primary: Color(0xFF505050),
fixedSize: Size(wid / 1.3, 55)),
onPressed: () {
Navigator.of(context).pushReplacement(MaterialPageRoute(builder: (context)=>auth()));
},
child: Text("Continue", style: TextStyle(fontSize: 20))),
)
],
),
),
);
}
}
| 0
|
mirrored_repositories/flutterecommerce_app_marvely/lib/files_dart
|
mirrored_repositories/flutterecommerce_app_marvely/lib/files_dart/about_developer/aboutme.dart
|
import 'package:double_back_to_close/toast.dart';
import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';
class about_developer extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Color(0xFF505050),
leading: Icon(Icons.arrow_back_outlined),
title: Text("About Developer", style: TextStyle()),
),
body: SafeArea(
child: ListView(
children: [
SizedBox(height: 10),
CircleAvatar(
radius: 80,
backgroundColor: Color(0xFF505050),
child: CircleAvatar(
radius: 80,
backgroundImage: AssetImage('assets/male.png'),
),
),
SizedBox(height: 20),
Center(
child: Text("Ashrafi Khandaker Abir",
style: TextStyle(
color: Colors.red,
fontSize: 30,
fontWeight: FontWeight.bold))),
SizedBox(height: 20),
Center(
child: Text("Use your brain, Make google your friend😶",
style: TextStyle(
color: Colors.black,
fontSize: 16,
fontWeight: FontWeight.bold))),
SizedBox(height:5),
Center(
child: Text("Nothing is perfect",
style: TextStyle(
color: Colors.black,
fontSize: 16,
fontWeight: FontWeight.bold))),
SizedBox(height:5),
Center(
child: Text("All systems are weak",
style: TextStyle(
color: Colors.black,
fontSize: 16,
fontWeight: FontWeight.bold))),
SizedBox(height:5),
Center(
child: Text("ಠ‿ಠ",
style: TextStyle(
color: Colors.black,
fontSize: 16,
fontWeight: FontWeight.bold))),
SizedBox(height:200),
Center(
child: ElevatedButton(
style: ElevatedButton.styleFrom(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(25)),
primary: Color(0xFF505050),
fixedSize: Size(200,50)),
onPressed: () {
Fluttertoast.showToast(msg: "Batch : 79");
},
child: Text("Batch Information", style: TextStyle(fontSize: 20))),
)
],
),
),
);
}
}
| 0
|
mirrored_repositories/flutterecommerce_app_marvely/lib/files_dart
|
mirrored_repositories/flutterecommerce_app_marvely/lib/files_dart/profile/profiles.dart
|
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:marvelyprojects/custom_widgets/custom_drawer.dart';
import 'package:marvelyprojects/files_dart/about_developer/aboutme.dart';
import 'package:marvelyprojects/files_dart/aurth_app/authpage.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:swipeable_page_route/swipeable_page_route.dart';
class profile extends StatefulWidget {
@override
_profileState createState() => _profileState();
}
class _profileState extends State<profile> {
String username_value = "";
String pass_value = "";
String name_value = "";
String email_value = "";
int gender_value = 0;
int day_value = 0;
int month_value = 0;
int year_value = 0;
@override
void initState() {
showperfer();
}
@override
setpageopen() async {
final preferset = await SharedPreferences.getInstance();
preferset.setString("pagedecidevalue","0");
}
showperfer() async {
final showdata = await SharedPreferences.getInstance();
setState(() {
username_value = showdata.getString("username")!;
pass_value = showdata.getString("password")!;
name_value = showdata.getString("name")!;
email_value = showdata.getString("email")!;
gender_value = showdata.getInt("gender")!;
day_value = showdata.getInt("day")!;
year_value = showdata.getInt("years")!;
month_value = showdata.getInt("month")!;
});
}
Widget build(BuildContext context) {
var hei = MediaQuery.of(context).size.height;
var wid = MediaQuery.of(context).size.width;
return Scaffold(
backgroundColor: Color(0xFF505050),
drawer: custom_drawer(),
appBar: AppBar(
backgroundColor: Color(0xFF505050),
elevation: 0,
title: Text("My Profile"),
),
body: SingleChildScrollView(
child: Stack(
children: [
Column(
children: [
Container(
height: hei/7.5,
color: Color(0xFF505050),
),
Container(
height: hei/1.31,
width: double.infinity,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(35),
topRight: Radius.circular(35),
),
),
child: ListView(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Padding(
padding: const EdgeInsets.only(right: 45,top:10),
child: Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text ('$name_value',style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: hei/45
),),
Text ('$email_value',style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: hei/45
),)
],
)
],
),
),
),
],
),
SizedBox(height: hei/55),
Divider(
thickness: 0.1,
color: Color(0xFF505050),
),
TextButton(onPressed: (){},
child: ListTile(
leading: Icon (Icons.account_circle_sharp,size: hei/23),
trailing: Icon (Icons.arrow_forward ,size: hei/23),
title: Text ("Account Information",style: GoogleFonts.notoSans(textStyle: TextStyle(
fontSize: hei/45,fontWeight: FontWeight.w400,
)),),
),
),
TextButton(onPressed: (){},
child: ListTile(
leading: Icon (Icons.shop_outlined,size: hei/23),
trailing: Icon (Icons.arrow_forward ,size: hei/23),
title: Text ("My Orders",style: GoogleFonts.notoSans(textStyle: TextStyle(
fontSize: hei/45,fontWeight: FontWeight.w400,
)),),
),
),
TextButton(onPressed: (){},
child: ListTile(
leading: Icon (Icons.location_on_outlined,size: hei/23),
trailing: Icon (Icons.arrow_forward ,size: hei/23),
title: Text ("My Delivery Address",style: GoogleFonts.notoSans(textStyle: TextStyle(
fontSize: hei/45,fontWeight: FontWeight.w400,
)),),
),
),
TextButton(onPressed: (){},
child: ListTile(
leading: Icon ( Icons.policy_outlined,size: hei/23),
trailing: Icon (Icons.arrow_forward ,size: hei/23),
title: Text ("Privacy Policy",style: GoogleFonts.notoSans(textStyle: TextStyle(
fontSize: hei/45,fontWeight: FontWeight.w400,
)),),
),
),
TextButton(onPressed: (){
Navigator.of(context).push(SwipeablePageRoute(
canOnlySwipeFromEdge: true,
builder: (BuildContext context) =>about_developer()));
},
child: ListTile(
leading: Icon (Icons.add_chart,size: hei/23),
trailing: Icon (Icons.arrow_forward ,size: hei/23),
title: Text ("About Developer",style: GoogleFonts.notoSans(textStyle: TextStyle(
fontSize: hei/45,fontWeight: FontWeight.w400,
)),),
),
),
TextButton(onPressed: (){
Navigator.of(context).push(SwipeablePageRoute(
canOnlySwipeFromEdge: true,
builder: (BuildContext context) =>auth()));
setpageopen();
},
child: ListTile(
leading: Icon (Icons.exit_to_app_outlined,size: hei/23),
trailing: Icon (Icons.arrow_forward ,size: hei/23),
title: Text ("Logout",style: GoogleFonts.notoSans(textStyle: TextStyle(
fontSize: hei/45,fontWeight: FontWeight.w400,
)),),
),
),
],
),
)
],
),
Positioned(
top: hei/15,
left: hei / 20,
child: CircleAvatar(
radius: hei/16,
backgroundColor: Color(0xFF505050),
child: CircleAvatar(
radius: hei/18,
backgroundImage: gender_value == 2 ? AssetImage('assets/female.png'):AssetImage('assets/male.png'),
),
)),
],
),
),
);
}
}
| 0
|
mirrored_repositories/flutterecommerce_app_marvely/lib/files_dart
|
mirrored_repositories/flutterecommerce_app_marvely/lib/files_dart/homepage/homepage.dart
|
import 'package:double_back_to_close/double_back_to_close.dart';
import 'package:flutter/material.dart';
import 'package:flutter_carousel_slider/carousel_slider.dart';
import 'package:flutter_carousel_slider/carousel_slider_transforms.dart';
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
import 'package:marvelyprojects/custom_widgets/custom_appbar.dart';
import 'package:marvelyprojects/custom_widgets/custom_drawer.dart';
import 'package:marvelyprojects/files_dart/homepage/productinformation.dart';
import 'package:marvelyprojects/files_dart/product_details/custom_product_details.dart';
import 'package:swipeable_page_route/swipeable_page_route.dart';
class homepage_app extends StatefulWidget {
@override
State<homepage_app> createState() => _homepage_appState();
}
class _homepage_appState extends State<homepage_app> {
productinformation product_data = productinformation();
bool favorite_icon_color = true;
final List<String> sliderimageurl = [
"assets/sliderimage1.png",
'assets/sliderimage2.png',
'assets/sliderimage3.png',
'assets/sliderimage4.png',
'assets/sliderimage5.png'
];
@override
void initState() {}
@override
Widget build(BuildContext context) {
var hei = MediaQuery.of(context).size.height;
var wid = MediaQuery.of(context).size.width;
return Scaffold(
appBar: CustomAppBar(),
drawer: custom_drawer(),
body: DoubleBack(
child: SafeArea(
child: ListView(
children: [
// Header Slider
Container(
child: Padding(
padding: EdgeInsets.only(
top: hei / 150,
left: wid / 75,
right: wid / 75,
bottom: hei / 150),
child: Container(
height: hei / 6,
child: CarouselSlider.builder(
autoSliderTransitionTime: Duration(seconds: 1),
autoSliderDelay: Duration(seconds: 5),
enableAutoSlider: true,
unlimitedMode: true,
slideTransform: ParallaxTransform(),
slideBuilder: (context) {
return Container(
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage(sliderimageurl[context]),
fit: BoxFit.fill),
color: Color(0xffEDEFF0),
borderRadius:
BorderRadiusDirectional.circular(13)),
alignment: Alignment.center,
);
},
itemCount: sliderimageurl.length),
),
),
),
// CategoryText
Padding(
padding: EdgeInsets.only(
top: hei / 150,
left: wid / 75,
right: wid / 75,
bottom: hei / 150),
child: Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
"Top Catagory",
style: TextStyle(
fontSize: hei / 40, fontWeight: FontWeight.bold),
),
InkWell(
onTap: () {},
child: Text(
"More",
style: TextStyle(
fontSize: hei / 45,
fontWeight: FontWeight.bold,
color: Colors.orange),
),
)
],
),
),
),
// Category button
Padding(
padding: EdgeInsets.only(
top: hei / 150,
left: wid / 75,
right: wid / 75,
bottom: hei / 150),
child: Container(
decoration: BoxDecoration(
color: Color(0xffEDEFF0),
borderRadius: BorderRadius.circular(15),
),
height: hei / 5,
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
InkWell(
onTap: () {},
child: Padding(
padding: EdgeInsets.only(
top: hei / 100,
left: wid / 75,
right: wid / 75,
bottom: hei / 150),
child: Container(
height: hei / 12,
width: wid / 6,
child: Column(
children: [
Image.asset(
"assets/catimg1.png",
height: hei / 17,
width: wid / 8,
),
Text(
"Gifts",
style: TextStyle(
color: Colors.black,
fontSize: hei / 55,
fontWeight: FontWeight.bold),
)
],
),
),
),
),
InkWell(
onTap: () {},
child: Container(
height: hei / 12,
width: wid / 6,
child: Column(
children: [
Image.asset(
"assets/catimg2.png",
height: hei / 17,
width: wid / 8,
),
Text(
"Discounts",
style: TextStyle(
color: Colors.black,
fontSize: hei / 55,
fontWeight: FontWeight.bold),
)
],
),
),
),
InkWell(
onTap: () {},
child: Container(
height: hei / 12,
width: wid / 6,
child: Column(
children: [
Image.asset(
"assets/catimg3.png",
height: hei / 17,
width: wid / 8,
),
Text(
"Shirts",
style: TextStyle(
color: Colors.black,
fontSize: hei / 55,
fontWeight: FontWeight.bold),
)
],
),
),
),
InkWell(
onTap: () {},
child: Container(
height: hei / 12,
width: wid / 6,
child: Column(
children: [
Image.asset(
"assets/catimg4.png",
height: hei / 17,
width: wid / 8,
),
Text(
"Foods",
style: TextStyle(
color: Colors.black,
fontSize: hei / 55,
fontWeight: FontWeight.bold),
)
],
),
),
),
],
),
),
Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
InkWell(
onTap: () {},
child: Container(
height: hei / 12,
width: wid / 6,
child: Column(
children: [
Image.asset(
"assets/catimg5.png",
height: hei / 17,
width: wid / 8,
),
Text(
"Health",
style: TextStyle(
color: Colors.black,
fontSize: hei / 55,
fontWeight: FontWeight.bold),
)
],
),
),
),
InkWell(
onTap: () {},
child: Container(
height: hei / 12,
width: wid / 6,
child: Column(
children: [
Image.asset(
"assets/catimg6.png",
height: hei / 17,
width: wid / 8,
),
Text(
"Live Tv",
style: TextStyle(
color: Colors.black,
fontSize: hei / 55,
fontWeight: FontWeight.bold),
)
],
),
),
),
InkWell(
onTap: () {},
child: Container(
height: hei / 12,
width: wid / 6,
child: Column(
children: [
Image.asset(
"assets/catimg7.png",
height: hei / 17,
width: wid / 8,
),
Text(
"Global",
style: TextStyle(
color: Colors.black,
fontSize: hei / 55,
fontWeight: FontWeight.bold),
)
],
),
),
),
InkWell(
onTap: () {},
child: Container(
height: hei / 12,
width: wid / 6,
child: Column(
children: [
Image.asset(
"assets/catimg8.png",
height: hei / 17,
width: wid / 8,
),
Text(
"Local",
style: TextStyle(
color: Colors.black,
fontSize: hei / 55,
fontWeight: FontWeight.bold),
)
],
),
),
),
],
),
),
],
),
),
),
// top products
Padding(
padding: EdgeInsets.only(
top: hei / 150,
left: wid / 75,
right: wid / 75,
bottom: hei / 150),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
"Popular Product",
style: TextStyle(
fontSize: hei / 38, fontWeight: FontWeight.bold),
),
InkWell(
onTap: () {},
child: Text(
"More",
style: TextStyle(
fontSize: hei / 45,
fontWeight: FontWeight.bold,
color: Colors.orange),
),
)
],
),
),
// top product list
GridView.builder(
shrinkWrap: true,
controller: ScrollController(keepScrollOffset: true),
itemCount: product_data.prouctname.length,
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
childAspectRatio: 0.62, crossAxisCount: 2),
itemBuilder: (Buildercontext, index) {
return Padding(
padding: EdgeInsets.only(
left: wid / 75, right: wid / 75, bottom: hei / 150),
child: InkWell(
onTap: () {
Navigator.of(context).push(SwipeablePageRoute(
canOnlySwipeFromEdge: true,
builder: (BuildContext context) =>
customproduct_details(
product_data.prouctname[index])));
},
child: Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(15)),
elevation: 20,
child: Column(
children: [
Padding(
padding: EdgeInsets.only(
top: hei / 150,
left: wid / 75,
right: wid / 75,
bottom: hei / 150),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
CircleAvatar(
backgroundColor: Color(0xFF505050),
child: Text(
product_data
.prouctname[index].parcentage,
style: TextStyle(color: Colors.white),
),
),
IconButton(
icon: Icon(Icons.favorite_border,
size: hei / 23),
onPressed: () {})
],
),
),
Image.network(
product_data.prouctname[index].imgurl,
height: hei / 5.2,
width: wid / 2.5,
),
SizedBox(
height: hei / 140,
),
Text(product_data.prouctname[index].title,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: hei / 45,
fontWeight: FontWeight.bold)),
SizedBox(
height: hei / 140,
),
Padding(
padding: EdgeInsets.only(left: wid / 30),
child: Row(
children: [
SizedBox(
width: wid / 70,
),
Text(
"৳" +
product_data
.prouctname[index].proprice
.toString(),
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.orange,
fontSize: hei / 33),
),
SizedBox(
width: wid / 77,
),
Text(
"৳" +
product_data.prouctname[index].price
.toString(),
style: TextStyle(
decoration:
TextDecoration.lineThrough,
decorationThickness: 2.0,
fontSize: hei / 50),
),
],
),
),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceEvenly,
children: [
Container(
child: RatingBarIndicator(
rating:
product_data.prouctname[index].rating,
itemBuilder: (context, index) => Icon(
Icons.star,
color: Colors.amber,
),
itemCount: 5,
itemSize: 16.0,
direction: Axis.horizontal,
),
),
Text(
"[${product_data.prouctname[index].proprice}]")
],
),
],
),
),
),
);
})
],
),
),
),
);
}
}
| 0
|
mirrored_repositories/flutterecommerce_app_marvely/lib/files_dart
|
mirrored_repositories/flutterecommerce_app_marvely/lib/files_dart/homepage/productinformation.dart
|
import 'package:marvelyprojects/files_dart/product_details/custom_product_display.dart';
class productinformation {
final List<custom_product_display> prouctname = [
custom_product_display(
"Stylish Black Shirt",
"https://github.com/ashrafiabir01/image-project/blob/main/naisproduct.png?raw=true",
5,
200,
0.1,
"55%",
500),
custom_product_display(
"Stylish White Shirt",
"https://purepng.com/public/uploads/large/purepng.com-white-mens-polo-shirtpolo-shirtcottongarmentsfebricwhitemens-1421526392154xt9zg.png",
4.6,
220,
0.1,
"80%",
340),
custom_product_display(
"Stylish Blue Shirt",
"https://purepng.com/public/uploads/large/purepng.com-blue-t-shirtclothingt-shirtt-shirtdressfashionclothshirt-691522330467vjhb0.png",
5,
1200,
0.1,
"30%",
1500),
custom_product_display(
"Stylish Red Shirt",
"https://purepng.com/public/uploads/large/red-t-shirt-plp.png",
5,
600,
0.1,
"40%",
900),
custom_product_display(
"Stylish Green Shirt",
"https://purepng.com/public/uploads/large/purepng.com-green-t-shirtclothingt-shirtt-shirtdressfashionclothshirt-691522330493iyjsl.png",
5,
240,
0.1,
"22%",
400),
custom_product_display(
"Yellow Polo Shirt",
"https://purepng.com/public/uploads/large/purepng.com-yellow-polo-shirtpolo-shirtcottongarmentsfebricpurple-1421526392119beols.png",
5,
00,
0.1,
"100%",
1500),
custom_product_display(
"Stylish Red Shirt",
"https://purepng.com/public/uploads/large/purepng.com-t-shirtclothingt-shirtfashion-dress-shirt-cloth-tshirt-631522326894filwv.png",
5,
1990,
0.1,
"20%",
2300),
custom_product_display(
"Stylish Orenge Shirt",
"https://purepng.com/public/uploads/large/purepng.com-t-shirt-orangefashiondressshirtclothtshirtclothingt-shirt-orange-631522326912s0fqp.png",
5,
786,
0.1,
"30%",
1000),
];
}
| 0
|
mirrored_repositories/flutterecommerce_app_marvely/lib/files_dart
|
mirrored_repositories/flutterecommerce_app_marvely/lib/files_dart/product_details/orderpage.dart
|
import 'package:flutter/material.dart';
import 'package:flutter_credit_card/credit_card_brand.dart';
import 'package:flutter_credit_card/credit_card_form.dart';
import 'package:flutter_credit_card/credit_card_model.dart';
import 'package:flutter_credit_card/credit_card_widget.dart';
import 'package:flutter_credit_card/custom_card_type_icon.dart';
import 'package:flutter_credit_card/glassmorphism_config.dart';
import 'package:marvelyprojects/controlpanel.dart';
import 'package:marvelyprojects/files_dart/product_details/custom_product_display.dart';
import 'package:swipeable_page_route/swipeable_page_route.dart';
class oder_now extends StatefulWidget {
@override
_oder_nowState createState() => _oder_nowState();
}
class _oder_nowState extends State<oder_now> {
String cardNumber = '';
String expiryDate = '';
String cardHolderName = '';
String cvvCode = '';
bool isCvvFocused = false;
bool useGlassMorphism = false;
bool useBackgroundImage = false;
OutlineInputBorder? border;
final GlobalKey<FormState> formKey = GlobalKey<FormState>();
@override
void initState() {
border = OutlineInputBorder(
borderSide: BorderSide(
color: Colors.grey.withOpacity(0.7),
width: 2.0,
),
);
super.initState();
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
decoration: BoxDecoration(
image: !useBackgroundImage
? const DecorationImage(
image: ExactAssetImage('assets/bg.png'),
fit: BoxFit.fill,
)
: null,
color: Colors.white,
),
child: SafeArea(
child: Column(
children: <Widget>[
const SizedBox(
height: 30,
),
Text("Add your payment method",style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 20
),),
const SizedBox(
height: 30,
),
CreditCardWidget(
glassmorphismConfig:
useGlassMorphism ? Glassmorphism.defaultConfig() : null,
cardNumber: cardNumber,
expiryDate: expiryDate,
cardHolderName: cardHolderName,
cvvCode: cvvCode,
showBackView: isCvvFocused,
obscureCardNumber: true,
obscureCardCvv: true,
isHolderNameVisible: true,
cardBgColor: Colors.red,
backgroundImage:
useBackgroundImage ? 'assets/card_bg.png' : null,
isSwipeGestureEnabled: true,
onCreditCardWidgetChange: (CreditCardBrand creditCardBrand) {},
customCardTypeIcons: <CustomCardTypeIcon>[
CustomCardTypeIcon(
cardType: CardType.mastercard,
cardImage: Image.asset(
'assets/mastercard.png',
height: 48,
width: 48,
),
),
],
),
Expanded(
child: SingleChildScrollView(
child: Column(
children: <Widget>[
CreditCardForm(
formKey: formKey,
obscureCvv: true,
obscureNumber: true,
cardNumber: cardNumber,
cvvCode: cvvCode,
isHolderNameVisible: true,
isCardNumberVisible: true,
isExpiryDateVisible: true,
cardHolderName: cardHolderName,
expiryDate: expiryDate,
themeColor: Colors.blue,
textColor: Colors.black,
cardNumberDecoration: InputDecoration(
labelText: 'Number',
hintText: 'XXXX XXXX XXXX XXXX',
hintStyle: const TextStyle(color: Colors.black),
labelStyle: const TextStyle(color: Colors.black),
focusedBorder: border,
enabledBorder: border,
),
expiryDateDecoration: InputDecoration(
hintStyle: const TextStyle(color: Colors.black),
labelStyle: const TextStyle(color: Colors.black),
focusedBorder: border,
enabledBorder: border,
labelText: 'Expired Date',
hintText: 'XX/XX',
),
cvvCodeDecoration: InputDecoration(
hintStyle: const TextStyle(color: Colors.black),
labelStyle: const TextStyle(color: Colors.black),
focusedBorder: border,
enabledBorder: border,
labelText: 'CVV',
hintText: 'XXX',
),
cardHolderDecoration: InputDecoration(
hintStyle: const TextStyle(color: Colors.black),
labelStyle: const TextStyle(color: Colors.black),
focusedBorder: border,
enabledBorder: border,
labelText: 'Card Holder',
),
onCreditCardModelChange: onCreditCardModelChange,
),
const SizedBox(
height: 20,
),
const SizedBox(
height: 20,
),
ElevatedButton(
style: ElevatedButton.styleFrom(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8.0),
),
primary: const Color(0xff1b447b),
),
child: Container(
margin: const EdgeInsets.all(12),
child: const Text(
'Validate',
style: TextStyle(
color: Colors.white,
fontFamily: 'halter',
fontSize: 14,
package: 'flutter_credit_card',
),
),
),
onPressed: () {
if (formKey.currentState!.validate()) {
print('valid!');
} else {
print('invalid!');
}
},
),
],
),
),
),
],
),
),
),
);
}
void onCreditCardModelChange(CreditCardModel? creditCardModel) {
setState(() {
cardNumber = creditCardModel!.cardNumber;
expiryDate = creditCardModel.expiryDate;
cardHolderName = creditCardModel.cardHolderName;
cvvCode = creditCardModel.cvvCode;
isCvvFocused = creditCardModel.isCvvFocused;
});
}
}
| 0
|
mirrored_repositories/flutterecommerce_app_marvely/lib/files_dart
|
mirrored_repositories/flutterecommerce_app_marvely/lib/files_dart/product_details/custom_product_display.dart
|
class custom_product_display {
String title, imgurl , parcentage;
int proprice,price;
double discount, rating;
custom_product_display(
this.title, this.imgurl, this.rating, this.proprice, this.discount,this.parcentage,this.price);
}
| 0
|
mirrored_repositories/flutterecommerce_app_marvely/lib/files_dart
|
mirrored_repositories/flutterecommerce_app_marvely/lib/files_dart/product_details/custom_product_details.dart
|
import 'package:flutter/material.dart';
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:marvelyprojects/files_dart/product_details/custom_product_display.dart';
import 'package:marvelyprojects/files_dart/product_details/orderpage.dart';
class customproduct_details extends StatefulWidget {
final custom_product_display product_details;
@override
_customproduct_detailsState createState() => _customproduct_detailsState();
customproduct_details(this.product_details);
}
class _customproduct_detailsState extends State<customproduct_details> {
@override
void initState() {
total_product_value = widget.product_details.proprice;
}
@override
int product_cart = 1;
late int total_product_value = 1;
cheacknumber() {
setState(() {
if (product_cart < 2) {
product_cart = 1;
}
});
}
cheackvalue(){
setState(() {
if (total_product_value<widget.product_details.proprice){
total_product_value = widget.product_details.proprice;
}
});
}
@override
Widget build(BuildContext context) {
var hei = MediaQuery.of(context).size.height;
var wid = MediaQuery.of(context).size.width;
show_cart(){
showModalBottomSheet(
context: context,
builder: (context) {
return StatefulBuilder(builder:
(BuildContext context, StateSetter setState) {
return Container(
child: Column(
children: [
Row(
children: [
Container(
height: hei / 10,
width: wid / 5,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
),
child: Image.network(
widget.product_details.imgurl),
),
Column(
children: [
Text(
"৳" +
widget.product_details.proprice
.toString(),
style: TextStyle(
fontSize: hei / 35,
color: Colors.orange),
),
Text(
"৳" +
widget.product_details.price
.toString(),
style: TextStyle(
fontSize: hei / 43,
decoration:
TextDecoration.lineThrough,
decorationThickness: 1.6),
),
],
),
SizedBox(
width: wid / 2,
),
IconButton(
onPressed: () {
Navigator.pop(context);
},
icon: Icon(
Icons.cancel,
size: hei / 25,
))
],
),
SizedBox(height: hei / 40),
Divider(
thickness: 2,
),
SizedBox(height: hei / 40),
Padding(
padding: EdgeInsets.only(
top: hei / 150,
left: wid / 75,
right: wid / 75,
bottom: hei / 150),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Text(
"Quantity",
style: TextStyle(fontSize: hei / 43),
),
Row(
children: [
IconButton(
onPressed: () {
setState(() {
product_cart--;
cheacknumber();
total_product_value =
total_product_value -
widget.product_details
.proprice;
cheackvalue();
});
},
icon: CircleAvatar(
maxRadius: 20,
child: Text(
"-",
style: TextStyle(
color: Colors.white,
fontSize: 24),
),
backgroundColor: Colors.black,
)),
SizedBox(width: 5),
Text(
"$product_cart",
style: TextStyle(
color: Colors.orange,
fontSize: hei / 30),
),
SizedBox(width: 5),
IconButton(
onPressed: () {
setState(() {
product_cart++;
total_product_value = widget
.product_details
.proprice *
product_cart;
});
},
icon: CircleAvatar(
child: Text(
"+",
style: TextStyle(
color: Colors.white,
fontSize: 24),
),
maxRadius: 20,
backgroundColor: Colors.black,
)),
],
)
],
),
),
SizedBox(height: hei / 40),
Divider(
thickness: 2,
),
Padding(
padding: EdgeInsets.only(
top: hei / 150,
left: wid / 75,
right: wid / 75,
bottom: hei / 150),
child: Row(
children: [
Text(
"Total : ",
style: TextStyle(fontSize: 20),
),
Text(
"৳" + "$total_product_value",
style: TextStyle(
fontSize: 24, color: Colors.orange),
)
],
),
),
SizedBox(
height: hei / 7,
),
Padding(
padding: EdgeInsets.only(
top: hei / 150,
left: wid / 75,
right: wid / 75,
bottom: hei / 150),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
InkWell(
onTap: (){
Fluttertoast.showToast(msg: "cart");
}
,child: Container(
width: wid / 2.2,
height: hei / 15,
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(6),
color: Colors.redAccent),
child: Center(
child: Text(
"Add to Cart",
style: TextStyle(
color: Colors.white,
fontSize: hei / 42,
fontWeight: FontWeight.bold,
),
),
),
),
),
InkWell(
onTap: (){
Navigator.push(context,MaterialPageRoute(builder: (context)=>oder_now()));
},
child: Container(
width: wid / 2.2,
height: hei / 15,
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(6),
color: Colors.orange),
child: Center(
child: Text(
"Buy Now",
style: TextStyle(
color: Colors.white,
fontSize: hei / 42,
fontWeight: FontWeight.bold,
),
),
),
),
),
],
),
),
],
),
);
;
});
});
}
return Scaffold(
backgroundColor: Colors.white,
bottomNavigationBar: BottomAppBar(
child: SizedBox(
height: hei / 11,
child: Row(
children: [
IconButton(
onPressed: () {},
icon: Icon(Icons.storefront_sharp),
iconSize: hei / 28,
color: Colors.orange),
Padding(
padding: EdgeInsets.only(top: hei / 100, bottom: hei / 100),
child: VerticalDivider(
color: Colors.black,
thickness: 1,
),
),
IconButton(
onPressed: () {},
icon: Icon(Icons.chat),
iconSize: hei / 28,
color: Colors.orange),
SizedBox(width: wid / 13),
InkWell(
onTap: () {
show_cart();
},
child: Container(
width: wid / 3.5,
height: hei / 15,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6),
color: Colors.redAccent),
child: Center(
child: Text(
"Add to Cart",
style: TextStyle(
color: Colors.white,
fontSize: hei / 42,
fontWeight: FontWeight.bold,
),
),
),
),
),
SizedBox(width: wid / 40),
InkWell(
onTap: (){
Navigator.push(context, MaterialPageRoute(builder: (context)=>oder_now()));
},
child: Padding(
padding: EdgeInsets.only(right: wid / 50),
child: Container(
width: wid / 3.5,
height: hei / 15,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6),
color: Colors.orange),
child: Center(
child: Text(
"Buy Now",
style: TextStyle(
color: Colors.white,
fontSize: hei / 42,
fontWeight: FontWeight.bold,
),
),
),
),
),
)
],
),
),
),
appBar: AppBar(
elevation: 0,
backgroundColor: Color(0xFF505050),
actions: [
IconButton(
onPressed: () {},
icon: Icon(Icons.shopping_cart, size: hei / 30)),
IconButton(
onPressed: () {},
icon: Icon(Icons.favorite_border, size: hei / 30))
],
leading: IconButton(
icon: Icon(Icons.arrow_back_outlined, size: hei / 30),
onPressed: () {
Navigator.pop(context);
},
),
),
body: SafeArea(
child: ListView(
children: [
Container(
color: Color(0xffEDEFF0),
height: hei / 3,
width: double.infinity,
child: Image.network(
widget.product_details.imgurl,
fit: BoxFit.fitHeight,
),
),
Padding(
padding: EdgeInsets.only(
top: hei / 150,
left: wid / 75,
right: wid / 75,
bottom: hei / 150),
child: Row(
children: [
Text(
"৳" + widget.product_details.proprice.toString(),
style: TextStyle(
fontSize: hei / 26,
color: Colors.orange,
fontWeight: FontWeight.bold),
),
SizedBox(width: wid / 2),
IconButton(
onPressed: () {},
icon: Icon(Icons.favorite_outline),
iconSize: hei / 27,
),
IconButton(
onPressed: () {},
icon: Icon(Icons.share),
iconSize: hei / 27,
),
],
),
),
Padding(
padding: EdgeInsets.only(
top: hei / 150,
left: wid / 75,
right: wid / 75,
bottom: hei / 150),
child: Row(
children: [
Text(
"৳" + widget.product_details.price.toString(),
style: TextStyle(
fontSize: hei / 43,
decoration: TextDecoration.lineThrough,
decorationThickness: 1.6),
),
SizedBox(
width: 10,
),
Text(widget.product_details.parcentage,
style: TextStyle(
fontWeight: FontWeight.bold, fontSize: hei / 40))
],
),
),
SizedBox(height: hei / 150),
Padding(
padding: EdgeInsets.only(
top: hei / 150,
left: wid / 75,
right: wid / 75,
bottom: hei / 150),
child: Align(
alignment: Alignment.centerLeft,
child: Text(
widget.product_details.title,
style: TextStyle(
fontWeight: FontWeight.bold, fontSize: hei / 47),
),
),
),
Padding(
padding: EdgeInsets.only(
top: hei / 150,
left: wid / 75,
right: wid / 75,
bottom: hei / 150),
child: Row(
children: [
RatingBarIndicator(
itemCount: 5,
itemSize: 20,
rating: widget.product_details.rating,
itemBuilder: (context, index) => Icon(
Icons.star,
color: Colors.amber,
),
),
Padding(
padding: EdgeInsets.only(left: 5),
child: Text(widget.product_details.rating.toString()),
),
],
),
),
Divider(
thickness: 2,
),
Padding(
padding: EdgeInsets.only(left: wid / 75, right: wid / 75),
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
"Variations",
style: TextStyle(fontSize: hei / 43),
),
IconButton(onPressed: () {}, icon: Icon(Icons.forward))
],
)
],
),
),
Divider(
thickness: 2,
),
Padding(
padding: EdgeInsets.only(
top: hei / 150,
left: wid / 75,
right: wid / 75,
bottom: hei / 150),
child: Row(
children: [
Text(
"Description",
style: TextStyle(fontSize: hei / 43),
),
],
),
),
Padding(
padding: EdgeInsets.only(
top: hei / 150,
left: wid / 75,
right: wid / 75,
bottom: hei / 150),
child: Text(
"E-commerce (electronic commerce) is the buying and selling of goods and services, or the transmitting of funds or data, over an electronic network, primarily the internet. These business transactions occur either as business-to-business (B2B), business-to-consumer (B2C), consumer-to-consumer or consumer-to-business.",
style: TextStyle(
fontSize: hei / 43,
),
textAlign: TextAlign.justify,
),
)
],
),
),
);
}
}
| 0
|
mirrored_repositories/flutterecommerce_app_marvely/lib/files_dart
|
mirrored_repositories/flutterecommerce_app_marvely/lib/files_dart/splash/splash.dart
|
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:marvelyprojects/controlpanel.dart';
import 'package:marvelyprojects/files_dart/aurth_app/authpage.dart';
import 'package:marvelyprojects/files_dart/pageview/pagecontrol_panel.dart';
import 'package:shared_preferences/shared_preferences.dart';
class splash extends StatefulWidget {
@override
State<splash> createState() => _splashState();
}
class _splashState extends State<splash> {
String pageopen = "aa";
@override
void initState() {
getpageopen();
Timer(Duration(seconds: 2), () {
if (pageopen=="1"){
// Navigator.push(context, MaterialPageRoute(builder: (context)=>homepage_app()));
Navigator.of(context).pushReplacement(MaterialPageRoute(builder: (context)=>main_controlpanel()));
}
else{
Navigator.of(context).pushReplacement(MaterialPageRoute(builder: (context)=>page_view()));
}
});
}
@override
getpageopen ()async {
final prefersget = await SharedPreferences.getInstance();
setState(() {
pageopen = prefersget.getString("pagedecidevalue")!;
});
}
Widget build(BuildContext context) {
var hei = MediaQuery.of(context).size.height;
var wid = MediaQuery.of(context).size.width;
return Scaffold(
backgroundColor: Color(0xFF422C94),
body: SafeArea (
child: SingleChildScrollView (
physics: NeverScrollableScrollPhysics(),
child: Container(
height: hei,
decoration: BoxDecoration(
gradient: LinearGradient (
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [
Color(0xFF422C94),
Color(0xFF395AAD),
Color(0xFF317BBD),
]
)
),
child: Column (
children: [
SizedBox(height: hei/2.7,),
Center(
child: Text ("Marvely",style: GoogleFonts.lora(textStyle: TextStyle(
color: Colors.white,fontSize: hei/11,fontWeight:FontWeight.bold
))),
),
SizedBox(height: hei/48.7,),
Text(''' "Most trusted online shopping" ''',style: TextStyle(
color: Colors.white,fontSize: hei/43
),),
SizedBox(height: hei/20,),
CircularProgressIndicator(
color: Colors.white,
)
],
),
),
),
),
);
}
}
| 0
|
mirrored_repositories/flutterecommerce_app_marvely/lib/files_dart
|
mirrored_repositories/flutterecommerce_app_marvely/lib/files_dart/notificationspage/notification.dart
|
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:http/http.dart' as http;
class notification extends StatefulWidget {
@override
_notificationState createState() => _notificationState();
}
class _notificationState extends State<notification> {
final _url = "https://raw.githubusercontent.com/ashrafiabir01/databse_test/main/notification.json";
var g_data = [];
@override
void initState() {
getdata_database();
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor:Color(0xFF505050),
title: Text("Notifications"),
),
body: Padding(
padding: EdgeInsets.only(top: 10,left: 10,right: 10),
child: ListView.builder(
itemCount: g_data.length,
itemBuilder: (context, index){
final load = g_data[index];
return Card(
elevation: 20,
child: ListTile(
leading: CircleAvatar(child: Icon(Icons.notifications)),
title: Text('${load['title']}',style: TextStyle(
fontSize: 20,color: Colors.blue
),),
subtitle:Text('${load['subtitle']}',style: TextStyle(
fontSize: 20, color: Color(0xFF505050),
),),
),
);
}),
),
);
}
getdata_database() async {
try {
final response = await http.get(Uri.parse(_url));
final jsondata =jsonDecode(response.body) as List;
setState(() {
g_data = jsondata;
});
} catch (e) {
Fluttertoast.showToast(
msg: "Plese check your Internet connection",
toastLength: Toast.LENGTH_LONG);
}
}
}
| 0
|
mirrored_repositories/flutterecommerce_app_marvely/lib/files_dart
|
mirrored_repositories/flutterecommerce_app_marvely/lib/files_dart/search/dearch.dart
|
import 'package:flutter/material.dart';
import 'package:marvelyprojects/files_dart/homepage/productinformation.dart';
class search extends StatefulWidget {
@override
_searchState createState() => _searchState();
}
class _searchState extends State<search> {
var row =[];
List result = [];
String query = '';
TextEditingController serchTC = TextEditingController();
productinformation product_data = productinformation();
@override
void initState() {
row = [
{
'name': 'product one',
'price': 100,
'des': 'this is a best product ever '
},
{
'name': 'product 2',
'price': 200,
'des': 'this is a best product ever '
},
{
'name': 'product 3',
'price': 300,
'des': 'this is a best product ever '
},
{
'name': 'product 4',
'price': 400,
'des': 'this is a best product ever '
}
];
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
actions: [
Container(
height: 20,
width: MediaQuery.of(context).size.width,
child: Padding(
padding: const EdgeInsets.all(4.0),
child: TextField(
controller: serchTC,
decoration: InputDecoration(
fillColor: Colors.white,
filled: true,
hintText: 'Search...'
),
onChanged: (v){
setState(() {
query= v;
setresult(query);
});
},
),
),
)
],
),
body: Stack(
children: [
Column(
children: [
Container(
child: query.isEmpty
?
ListView.builder(
shrinkWrap: true,
itemCount: row.length,
itemBuilder: (_,i){
return Card(
child: ListTile(
title: Text(row[i]['name']),
onTap: (){
setState(() {
serchTC.text = row[i]['name'];
query = row[i]['name'];
setresult(query);
});
},
),
);
})
:
ListView.builder(
shrinkWrap: true,
itemCount: result.length,
itemBuilder: (_,i){
return Card(
child: ListTile(
title: Text(result[i]['name']),
onTap: (){
setState(() {
serchTC.text = result[i]['name'];
query = result[i]['name'];
setresult(query);
});
},
),
);
}),
)
],
)
],
),
);
}
void setresult(String query){
result = row.where((element) =>
element['name'].toString().toLowerCase().contains(query.toLowerCase()) ||
element['price'].toString().toLowerCase().contains(query.toLowerCase())).toList();
}
}
| 0
|
mirrored_repositories/flutterecommerce_app_marvely/lib
|
mirrored_repositories/flutterecommerce_app_marvely/lib/custom_widgets/custom_drawer.dart
|
import 'package:flutter/material.dart';
import 'package:marvelyprojects/controlpanel.dart';
import 'package:shared_preferences/shared_preferences.dart';
class custom_drawer extends StatefulWidget {
@override
State<custom_drawer> createState() => _custom_drawerState();
}
class _custom_drawerState extends State<custom_drawer> {
int gender_value = 0;
String name_value = "";
@override
void initState() {
// TODO: implement initState
showperfer();
}
@override
showperfer() async {
final showdata = await SharedPreferences.getInstance();
setState(() {
name_value = showdata.getString("name")!;
gender_value = showdata.getInt("gender")!;
});
}
Widget build(BuildContext context) {
var hei = MediaQuery.of(context).size.height;
var wid = MediaQuery.of(context).size.width;
return Align(
alignment: Alignment.topLeft,
child: Drawer(
child: Container(
color: Color(0xFF505050),
child: Column(
children: [
DrawerHeader(
child: Row(
children: [
Container(
height: hei / 10,
width: hei / 10,
child: CircleAvatar(
radius: hei / 16,
backgroundColor: Color(0xFF505050),
backgroundImage: gender_value == 2
? AssetImage('assets/female.png')
: AssetImage('assets/male.png'),
),
),
SizedBox(width: hei / 40),
Container(
child: Column(
children: [
SizedBox(height: hei / 18),
Text(
"Welcome Guest",
style: TextStyle(
fontSize: hei / 34, color: Colors.white),
),
Text(
"$name_value",
style: TextStyle(color: Colors.white),
)
],
),
)
],
)),
Padding(
padding: const EdgeInsets.all(8.0),
child: ListTile(
onTap: () {
Navigator.of(context).pushReplacement(MaterialPageRoute(builder: (context)=>main_controlpanel()));
},
leading:
Icon(Icons.home, size: hei / 24, color: Colors.white),
title: Text("Home",
style:
TextStyle(fontSize: hei / 34, color: Colors.white)),
),
),
Padding(
padding:EdgeInsets.all(8.0),
child: ListTile(
onTap: () {},
leading: Icon(Icons.shopping_cart,
size: hei / 24, color: Colors.white),
title: Text("My Orders",
style:
TextStyle(fontSize: hei / 34, color: Colors.white)),
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: ListTile(
onTap: () {},
leading: Icon(Icons.notifications,
size: hei / 24, color: Colors.white),
title: Text("Notifications",
style:
TextStyle(fontSize: hei / 34, color: Colors.white)),
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: ListTile(
onTap: () {},
leading: Icon(Icons.star_border,
size: hei / 24, color: Colors.white),
title: Text("Rate this appp",
style:
TextStyle(fontSize: hei / 34, color: Colors.white)),
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: ListTile(
onTap: () {},
leading: Icon(Icons.call,
size: hei / 24, color: Colors.white),
title: Text("Contract Support",
style:
TextStyle(fontSize: hei / 34, color: Colors.white)),
),
),
SizedBox(height: hei / 34),
SizedBox(height: hei / 34),
Text('''V 1.0(4)''',
style: TextStyle(
color: Colors.white, fontWeight: FontWeight.bold))
],
),
),
),
);
}
}
| 0
|
mirrored_repositories/flutterecommerce_app_marvely/lib
|
mirrored_repositories/flutterecommerce_app_marvely/lib/custom_widgets/custom_bottomnavigationbar.dart
|
import 'package:flutter/material.dart';
import 'package:marvelyprojects/files_dart/cart/cart.dart';
import 'package:marvelyprojects/files_dart/homepage/homepage.dart';
import 'package:marvelyprojects/files_dart/notificationspage/notification.dart';
import 'package:marvelyprojects/files_dart/profile/profiles.dart';
class custom_bottomnavigationbar extends StatefulWidget {
@override
_custom_bottomnavigationbarState createState() =>
_custom_bottomnavigationbarState();
}
class _custom_bottomnavigationbarState
extends State<custom_bottomnavigationbar> {
int _index_position = 0;
final tabs = [homepage_app(), notification(), cart(), profile()];
@override
Widget build(BuildContext context) {
var hei = MediaQuery.of(context).size.height;
var wid = MediaQuery.of(context).size.width;
return Scaffold(
bottomNavigationBar: BottomNavigationBar(
showUnselectedLabels: false,
selectedItemColor: Colors.orange,
selectedFontSize: hei / 50,
iconSize: hei / 22,
unselectedFontSize: hei / 50,
currentIndex: _index_position,
backgroundColor: Color(0xFF505050),
onTap: (int index) {
setState(() {
_index_position = index;
});
},
selectedLabelStyle: TextStyle(color: Colors.white),
type: BottomNavigationBarType.fixed,
unselectedLabelStyle: TextStyle(color: Colors.white),
items: [
BottomNavigationBarItem(
icon: Icon(Icons.home, color: Colors.white), label: "Home"),
BottomNavigationBarItem(
icon: Icon(Icons.notifications, color: Colors.white),
label: "Notification"),
BottomNavigationBarItem(
icon: Icon(Icons.shopping_cart, color: Colors.white),
label: "Cart"),
BottomNavigationBarItem(
icon: Icon(Icons.account_circle, color: Colors.white),
label: "Profile"),
]),
body: tabs[_index_position],
);
}
}
| 0
|
mirrored_repositories/flutterecommerce_app_marvely/lib
|
mirrored_repositories/flutterecommerce_app_marvely/lib/custom_widgets/custom_appbar.dart
|
import 'package:flutter/material.dart';
import 'package:marvelyprojects/files_dart/search/dearch.dart';
class CustomAppBar extends StatefulWidget implements PreferredSizeWidget {
CustomAppBar({Key, key})
: preferredSize = Size.fromHeight(60.0),
super(key: key);
@override
final Size preferredSize;
@override
_CustomAppBarState createState() => _CustomAppBarState();
}
class _CustomAppBarState extends State<CustomAppBar> {
@override
Widget build(BuildContext context) {
var hei = MediaQuery.of(context).size.height;
var wid = MediaQuery.of(context).size.width;
return AppBar(
elevation: 0,
backgroundColor: Color(0xFF505050),
title: InkWell(
onTap: () {
Navigator.push(context,MaterialPageRoute(builder:(context)=>search()));
},
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(7), color: Colors.white),
height: hei / 23,
width: wid / 1,
child: Row(
//crossAxisAlignment: MainAxisAlignment.center,
children: [
Icon(
Icons.search,
size: hei / 24,
color: Colors.black12,
),
Text(
" nais product",
style: TextStyle(
color: Colors.black12,
),
),
],
),
),
),
actions: [
Padding(
padding: const EdgeInsets.only(right: 7),
child: Icon(Icons.qr_code, size: hei / 23),
)
],
);
}
}
| 0
|
mirrored_repositories/flutterecommerce_app_marvely/lib
|
mirrored_repositories/flutterecommerce_app_marvely/lib/admin_panel/admin_dashboard.dart
|
import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:http/http.dart' as http;
class admin_dashboard extends StatefulWidget {
@override
_admin_dashboardState createState() => _admin_dashboardState();
}
class _admin_dashboardState extends State<admin_dashboard> {
TextEditingController product_id = TextEditingController();
TextEditingController product_title = TextEditingController();
TextEditingController product_categoty = TextEditingController();
TextEditingController product_description = TextEditingController();
TextEditingController product_price = TextEditingController();
TextEditingController product_discount = TextEditingController();
TextEditingController product_rating = TextEditingController();
TextEditingController product_url = TextEditingController();
@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: ListView(
children: [
Center(
child: Text(
"Add Product",
style: TextStyle(color: Colors.red, fontSize: 40),
)),
Text("\n"),
Text("Product Title : \n",
style: TextStyle(color: Colors.blueAccent, fontSize: 23)),
TextField(
controller: product_title,
style: TextStyle(color: Colors.black, fontSize: 17),
decoration: InputDecoration(
hintText: "Title",
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.deepOrange)),
border: OutlineInputBorder()),
),
Text("\n"),
Text("Product Category : \n",
style: TextStyle(color: Colors.blueAccent, fontSize: 23)),
TextField(
controller: product_categoty,
style: TextStyle(color: Colors.black, fontSize: 17),
decoration: InputDecoration(
hintText: "Category",
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.deepOrange)),
border: OutlineInputBorder()),
),
Text("\n"),
Text("Product ID : \n",
style: TextStyle(color: Colors.blueAccent, fontSize: 23)),
TextField(
controller: product_id,
style: TextStyle(color: Colors.black, fontSize: 17),
decoration: InputDecoration(
hintText: "ID",
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.deepOrange)),
border: OutlineInputBorder()),
),
Text("\n"),
Text("Product Description : \n",
style: TextStyle(color: Colors.blueAccent, fontSize: 23)),
TextField(
controller: product_description,
style: TextStyle(color: Colors.black, fontSize: 17),
decoration: InputDecoration(
hintText: "Description",
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.deepOrange)),
border: OutlineInputBorder()),
),
Text("\n"),
Text("Product Price : \n",
style: TextStyle(color: Colors.blueAccent, fontSize: 23)),
TextField(
controller: product_price,
style: TextStyle(color: Colors.black, fontSize: 17),
decoration: InputDecoration(
hintText: "Price",
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.deepOrange)),
border: OutlineInputBorder()),
),
Text("\n"),
Text("Product Discount : \n",
style: TextStyle(color: Colors.blueAccent, fontSize: 23)),
TextField(
controller: product_discount,
style: TextStyle(color: Colors.black, fontSize: 17),
decoration: InputDecoration(
hintText: "Discount",
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.deepOrange)),
border: OutlineInputBorder()),
),
Text("\n"),
Text("Product Rating : \n",
style: TextStyle(color: Colors.blueAccent, fontSize: 23)),
TextField(
controller: product_rating,
style: TextStyle(color: Colors.black, fontSize: 17),
decoration: InputDecoration(
hintText: "Rating",
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.deepOrange)),
border: OutlineInputBorder()),
),
Text("\n"),
Text("Product Img Url : \n",
style: TextStyle(color: Colors.blueAccent, fontSize: 23)),
TextField(
controller: product_url,
style: TextStyle(color: Colors.black, fontSize: 17),
decoration: InputDecoration(
hintText: "URl",
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.deepOrange)),
border: OutlineInputBorder()),
),
SizedBox(
height: 20,
),
Center(
child: ElevatedButton(
style: ElevatedButton.styleFrom(
fixedSize: Size(200, 50), primary: Colors.red),
onPressed: () {
add_porduct();
product_url.clear();
product_rating.clear();
product_discount.clear();
product_id.clear();
product_categoty.clear();
product_price.clear();
product_description.clear();
},
child: Text(
"Submit",
style: TextStyle(fontSize: 20),
)),
)
],
),
),
),
);
}
add_porduct() async {
try {
final add_product = await http.get(Uri.parse(
"http://127.0.0.1:3333/details/products/add/${product_id.text}-${product_url.text}-${product_title.text}-${product_description.text}-${product_rating.text}-${product_categoty.text}-${product_discount.text}-${product_price.text}"));
} catch (e) {
Fluttertoast.showToast(
msg: "Plese check your Internet connection",
toastLength: Toast.LENGTH_LONG);
}
}
}
| 0
|
mirrored_repositories/flutterecommerce_app_marvely
|
mirrored_repositories/flutterecommerce_app_marvely/test/widget_test.dart
|
// This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility that Flutter provides. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
//import 'package:marvelyprojects/files_dart/location/location.dart';
import 'package:marvelyprojects/main.dart';
void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(const mainclass());
// Verify that our counter starts at 0.
expect(find.text('0'), findsOneWidget);
expect(find.text('1'), findsNothing);
// Tap the '+' icon and trigger a frame.
await tester.tap(find.byIcon(Icons.add));
await tester.pump();
// Verify that our counter has incremented.
expect(find.text('0'), findsNothing);
expect(find.text('1'), findsOneWidget);
});
}
| 0
|
mirrored_repositories/flutterecommerce_app_marvely/web
|
mirrored_repositories/flutterecommerce_app_marvely/web/lib/main.dart
|
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
// This is the theme of your application.
//
// Try running your application with "flutter run". You'll see the
// application has a blue toolbar. Then, without quitting the app, try
// changing the primarySwatch below to Colors.green and then invoke
// "hot reload" (press "r" in the console where you ran "flutter run",
// or simply save your changes to "hot reload" in a Flutter IDE).
// Notice that the counter didn't reset back to zero; the application
// is not restarted.
primarySwatch: Colors.blue,
),
home: const MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({Key? key, required this.title}) : super(key: key);
// This widget is the home page of your application. It is stateful, meaning
// that it has a State object (defined below) that contains fields that affect
// how it looks.
// This class is the configuration for the state. It holds the values (in this
// case the title) provided by the parent (in this case the App widget) and
// used by the build method of the State. Fields in a Widget subclass are
// always marked "final".
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
int _counter = 0;
void _incrementCounter() {
setState(() {
// This call to setState tells the Flutter framework that something has
// changed in this State, which causes it to rerun the build method below
// so that the display can reflect the updated values. If we changed
// _counter without calling setState(), then the build method would not be
// called again, and so nothing would appear to happen.
_counter++;
});
}
@override
Widget build(BuildContext context) {
// This method is rerun every time setState is called, for instance as done
// by the _incrementCounter method above.
//
// The Flutter framework has been optimized to make rerunning build methods
// fast, so that you can just rebuild anything that needs updating rather
// than having to individually change instances of widgets.
return Scaffold(
appBar: AppBar(
// Here we take the value from the MyHomePage object that was created by
// the App.build method, and use it to set our appbar title.
title: Text(widget.title),
),
body: Center(
// Center is a layout widget. It takes a single child and positions it
// in the middle of the parent.
child: Column(
// Column is also a layout widget. It takes a list of children and
// arranges them vertically. By default, it sizes itself to fit its
// children horizontally, and tries to be as tall as its parent.
//
// Invoke "debug painting" (press "p" in the console, choose the
// "Toggle Debug Paint" action from the Flutter Inspector in Android
// Studio, or the "Toggle Debug Paint" command in Visual Studio Code)
// to see the wireframe for each widget.
//
// Column has various properties to control how it sizes itself and
// how it positions its children. Here we use mainAxisAlignment to
// center the children vertically; the main axis here is the vertical
// axis because Columns are vertical (the cross axis would be
// horizontal).
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
const Text(
'You have pushed the button this many times:',
),
Text(
'$_counter',
style: Theme.of(context).textTheme.headline4,
),
],
),
),
floatingActionButton: FloatingActionButton(
onPressed: _incrementCounter,
tooltip: 'Increment',
child: const Icon(Icons.add),
), // This trailing comma makes auto-formatting nicer for build methods.
);
}
}
| 0
|
mirrored_repositories/flutterecommerce_app_marvely/web
|
mirrored_repositories/flutterecommerce_app_marvely/web/test/widget_test.dart
|
// This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility that Flutter provides. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:web/main.dart';
void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(const MyApp());
// Verify that our counter starts at 0.
expect(find.text('0'), findsOneWidget);
expect(find.text('1'), findsNothing);
// Tap the '+' icon and trigger a frame.
await tester.tap(find.byIcon(Icons.add));
await tester.pump();
// Verify that our counter has incremented.
expect(find.text('0'), findsNothing);
expect(find.text('1'), findsOneWidget);
});
}
| 0
|
mirrored_repositories/Weather-App
|
mirrored_repositories/Weather-App/lib/secrets.dart
|
const openWeatherAPIKey = '32eaca329590d8262fac84eb5de5a30f';
| 0
|
mirrored_repositories/Weather-App
|
mirrored_repositories/Weather-App/lib/hourly_forecast_item.dart
|
import 'package:flutter/material.dart';
class HourlyForecastItem extends StatelessWidget {
final String time;
final String temp;
final icon;
const HourlyForecastItem({
super.key,
required this.time,
required this.temp,
required this.icon,
});
@override
Widget build(BuildContext context) {
return SizedBox(
width: 100,
child: Card(
elevation: 10,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
),
child: Container(
decoration: BoxDecoration(
gradient: const LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomLeft,
colors: [
Color.fromRGBO(65, 100, 220, 0.984),
Color(0xff68A5EA)
]),
borderRadius: BorderRadius.circular(10),
),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
children: [
Text(
time,
style: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
color: Colors.white,
),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
const SizedBox(
height: 8,
),
Icon(
icon,
size: 32,
color: Colors.yellow,
),
const SizedBox(
height: 8,
),
Text(
temp,
style: const TextStyle(
fontWeight: FontWeight.normal,
color: Colors.white,
),
),
],
),
),
),
),
);
}
}
| 0
|
mirrored_repositories/Weather-App
|
mirrored_repositories/Weather-App/lib/additional_items.dart
|
import 'package:flutter/material.dart';
class AdditionalItems extends StatelessWidget {
final IconData icon;
final String label;
final String value;
const AdditionalItems({
super.key,
required this.icon,
required this.label,
required this.value,
});
@override
Widget build(BuildContext context) {
return Column(
children: [
Icon(
icon,
size: 32,
color: Colors.white,
),
const SizedBox(
height: 8,
),
Text(
label,
style: const TextStyle(color: Colors.white),
),
const SizedBox(
height: 8,
),
Text(
value,
style: const TextStyle(
fontSize: 16, fontWeight: FontWeight.bold, color: Colors.white),
),
],
);
}
}
| 0
|
mirrored_repositories/Weather-App
|
mirrored_repositories/Weather-App/lib/main.dart
|
import 'package:flutter/material.dart';
import 'weather_page.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(
scaffoldBackgroundColor: const Color.fromRGBO(65, 100, 220, 0.984),
),
debugShowCheckedModeBanner: false,
home: const WeatherPage(),
);
}
}
| 0
|
mirrored_repositories/Weather-App
|
mirrored_repositories/Weather-App/lib/weather_page.dart
|
import 'dart:convert';
import 'dart:ui';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'package:weather_app/hourly_forecast_item.dart';
import 'package:weather_app/additional_items.dart';
import 'package:http/http.dart' as http;
import 'package:weather_app/secrets.dart';
class WeatherPage extends StatefulWidget {
const WeatherPage({super.key});
@override
State<WeatherPage> createState() => _WeatherPageState();
}
class _WeatherPageState extends State<WeatherPage> {
Future<Map<String, dynamic>> getCurrentWeather() async {
try {
String cityName = 'Delhi';
final res = await http.get(
Uri.parse(
'https://api.openweathermap.org/data/2.5/forecast?q=$cityName&APPID=$openWeatherAPIKey',
),
);
final data = jsonDecode(res.body);
if (data['cod'] != '200') {
throw "An unexpected error occurred";
}
return data;
} catch (e) {
throw e.toString();
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: const Color.fromRGBO(65, 100, 220, 0.984),
title: const Text(
"Weather App",
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20),
),
centerTitle: true,
elevation: 0,
actions: [
IconButton(
onPressed: () {
setState(() {});
},
icon: const Icon(Icons.refresh),
),
],
),
body: FutureBuilder(
future: getCurrentWeather(),
builder: (context, snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) {
return const Center(child: CircularProgressIndicator.adaptive());
}
if (snapshot.hasError) {
return Center(child: Text(snapshot.error.toString()));
}
final data = snapshot.data!;
final currentWeatherData = data['list'][0];
final currentTemp =
(currentWeatherData['main']['temp'] - 273.15).toStringAsFixed(1);
final currentSky = currentWeatherData['weather'][0]['main'];
final currentPressure = currentWeatherData['main']['pressure'];
final currentWindSpeed = currentWeatherData['wind']['speed'];
final currentHumidity = currentWeatherData['main']['humidity'];
return Container(
decoration: const BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topRight,
end: Alignment.bottomCenter,
colors: [
Color.fromRGBO(65, 100, 220, 0.984),
Color(0xff68A5EA)
]),
),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
children: [
//-----------------main card----------------
SizedBox(
width: double.infinity,
child: Card(
elevation: 10,
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(18),
),
child: Container(
decoration: BoxDecoration(
gradient: const LinearGradient(
begin: Alignment.topRight,
end: Alignment.bottomCenter,
colors: [
Color.fromRGBO(65, 100, 220, 0.984),
Color(0xff68A5EA)
]),
borderRadius: BorderRadius.circular(18),
),
child: ClipRRect(
borderRadius: BorderRadius.circular(18),
child: BackdropFilter(
filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10),
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
children: [
Text(
'$currentTemp°C',
style: const TextStyle(
color: Colors.white,
fontSize: 32,
fontWeight: FontWeight.bold),
),
const SizedBox(
height: 16,
),
Icon(
currentSky == "Clouds" ||
currentSky == "Rain"
? Icons.cloud
: Icons.sunny,
size: 64,
color: currentSky == "Clouds" ||
currentSky == "Rain"
? Colors.yellow
: Colors.grey,
),
const SizedBox(
height: 16,
),
Text(
currentSky,
style: const TextStyle(
color: Colors.white,
fontSize: 20,
fontWeight: FontWeight.normal),
),
],
),
),
),
),
),
),
),
const SizedBox(
height: 20,
),
const Align(
alignment: Alignment.centerLeft,
child: Text(
"Hourly Forecast",
style: TextStyle(
fontSize: 22,
fontWeight: FontWeight.bold,
color: Colors.white,
),
),
),
const SizedBox(
height: 14,
),
SizedBox(
height: 120,
child: ListView.builder(
scrollDirection: Axis.horizontal,
itemCount: 5,
itemBuilder: (BuildContext context, int index) {
final hourlyForecast = data['list'][index + 1];
final hourlyForecastTemp =
(hourlyForecast['main']['temp'] - 273.15)
.toStringAsFixed(1);
final hourlySky =
data['list'][index + 1]['weather'][0]['main'];
final time = DateTime.parse(hourlyForecast['dt_txt']);
return HourlyForecastItem(
time: DateFormat('j').format(time),
temp: '$hourlyForecastTemp°C',
icon: hourlySky == 'Clouds' || hourlySky == 'Rain'
? Icons.cloud
: Icons.sunny,
);
},
),
),
const SizedBox(
height: 20,
),
const Align(
alignment: Alignment.centerLeft,
child: Text(
"Additional Information",
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
color: Colors.white,
),
),
),
const SizedBox(
height: 16,
),
Card(
elevation: 6,
shape: BeveledRectangleBorder(
borderRadius: BorderRadius.circular(10),
),
child: ClipRRect(
borderRadius: BorderRadius.circular(10),
child: BackdropFilter(
filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10),
child: Container(
decoration: BoxDecoration(
gradient: const LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomLeft,
colors: [
Color.fromRGBO(65, 100, 220, 0.984),
Color(0xff68A5EA)
]),
borderRadius: BorderRadius.circular(10),
),
child: Padding(
padding: const EdgeInsets.all(10.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
AdditionalItems(
icon: Icons.water_drop,
label: "Humidity",
value: currentHumidity.toString(),
),
AdditionalItems(
icon: Icons.air,
label: "Wind Speed",
value: currentWindSpeed.toString(),
),
AdditionalItems(
icon: Icons.beach_access,
label: "Pressure",
value: currentPressure.toString(),
),
],
),
),
),
),
),
),
const SizedBox(
height: 20,
),
],
),
),
);
},
),
);
}
}
| 0
|
mirrored_repositories/Weather-App
|
mirrored_repositories/Weather-App/test/widget_test.dart
|
// This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility in the flutter_test package. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:weather_app/main.dart';
void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(const MyApp());
// Verify that our counter starts at 0.
expect(find.text('0'), findsOneWidget);
expect(find.text('1'), findsNothing);
// Tap the '+' icon and trigger a frame.
await tester.tap(find.byIcon(Icons.add));
await tester.pump();
// Verify that our counter has incremented.
expect(find.text('0'), findsNothing);
expect(find.text('1'), findsOneWidget);
});
}
| 0
|
mirrored_repositories/App-TigerFit
|
mirrored_repositories/App-TigerFit/lib/main.dart
|
// ignore_for_file: prefer_const_constructors
import 'package:flutter/material.dart';
import 'package:tigerfit/views/home.dart';
void main() {
runApp(
MaterialApp(
home: Home(),
debugShowCheckedModeBanner: false,
)
);
}
| 0
|
mirrored_repositories/App-TigerFit/lib
|
mirrored_repositories/App-TigerFit/lib/views/home.dart
|
// ignore_for_file: prefer_const_constructors, prefer_const_literals_to_create_immutables, sort_child_properties_last
import 'package:bottom_navy_bar/bottom_navy_bar.dart';
import 'package:flutter/material.dart';
class Home extends StatefulWidget {
const Home({super.key});
@override
State<Home> createState() => _HomeState();
}
class _HomeState extends State<Home> {
int pagina = 0;
PageController controller = PageController(initialPage: 0);
TextEditingController pesoController = TextEditingController();
TextEditingController alturaController = TextEditingController();
String info = "";
GlobalKey<FormState> formkey = GlobalKey<FormState>();
final TextEditingController emailController = TextEditingController();
final TextEditingController senhaController = TextEditingController();
void calcular() {
setState(() {
double peso = double.parse(pesoController.text);
double altura = double.parse(alturaController.text) / 100;
double imc = peso / (altura * altura);
//print(imc);
if (imc < 18.5) {
info = "Abaixo do peso (${imc.toStringAsPrecision(3)})";
} else if (imc >= 18.5 && imc <= 24.9) {
info = "Peso normal(${imc.toStringAsPrecision(3)})";
} else if (imc >= 25.0 && imc <= 29.9) {
info = "Sobrepeso(${imc.toStringAsPrecision(3)})";
} else if (imc >= 30.0 && imc <= 34.9) {
info = "Obesidade grau 1 (${imc.toStringAsPrecision(3)})";
} else {
info = "Obesidade grau 2 (${imc.toStringAsPrecision(3)})";
}
});
}
int _selectedIndex = 0;
void _onItemTapped(int index) {
setState(() {
_selectedIndex = index;
});
}
/*void _abrirIMC() {
Navigator.push(context, MaterialPageRoute(builder: (context) => Imc()));
}
void _abrirHome() {
Navigator.push(context, MaterialPageRoute(builder: (context) => Home()));
}
void _abrirFinanceiro() {
Navigator.push(
context, MaterialPageRoute(builder: (context) => Financeiro()));
}
void _abrirTreino() {
Navigator.push(context, MaterialPageRoute(builder: (context) => Treino()));
}
void _abrirManu() {
Navigator.push(
context, MaterialPageRoute(builder: (context) => Manutencao()));
}*/
void resetCampos() {
pesoController.text = "";
alturaController.text = "";
setState(() {
info = "";
});
}
@override
void dispose() {
controller.dispose();
super.dispose();
}
Widget _buildTreino(String title, String image) {
return Card(
color: Colors.black,
margin: EdgeInsets.symmetric(horizontal: 16),
child: ListTile(
leading: Image.asset(
image,
height: 80,
width: 80,
),
title: Text(
title,
style: TextStyle(color: Colors.white),
),
trailing: Icon(
Icons.arrow_forward_ios,
color: Colors.white,
),
onTap: () {},
),
);
}
@override
Widget build(BuildContext context) {
return Scaffold(
drawer: Drawer(
backgroundColor: Color.fromRGBO(0, 0, 0, 1),
shadowColor: Color.fromARGB(255, 255, 0, 0),
child: ListView(
padding: EdgeInsets.zero,
children: [
DrawerHeader(
decoration: BoxDecoration(
color: Color.fromRGBO(0, 0, 0, 1),
),
child: Image.asset("images/Logo TigerFit Branco.png"),
),
ListTile(
leading: Icon(Icons.person,
color: const Color.fromARGB(255, 255, 255, 255)),
title: Text(
"Minha Conta",
style: TextStyle(
color: const Color.fromARGB(255, 255, 255, 255),
fontSize: 20),
),
onTap: () {
// _abrirManu();
},
),
ListTile(
leading: Icon(
Icons.home,
color: const Color.fromARGB(255, 255, 255, 255),
),
title: Text(
"Início",
style: TextStyle(
color: const Color.fromARGB(255, 255, 255, 255),
fontSize: 20,
),
),
onTap: () {
// _abrirHome();
},
),
ListTile(
leading: Icon(Icons.monetization_on_outlined,
color: const Color.fromARGB(255, 255, 255, 255)),
title: Text(
"Financeiro",
style: TextStyle(
color: const Color.fromARGB(255, 255, 255, 255),
fontSize: 20,
),
),
onTap: () {
// _abrirFinanceiro();
},
),
ListTile(
leading: Icon(Icons.fitness_center,
color: const Color.fromARGB(255, 255, 255, 255)),
title: Text(
"Treinos",
style: TextStyle(
color: const Color.fromARGB(255, 255, 255, 255),
fontSize: 20,
),
),
onTap: () {
// _abrirTreino();
},
),
ListTile(
leading: Icon(Icons.monitor_weight,
color: const Color.fromARGB(255, 255, 255, 255)),
title: Text(
"IMC",
style: TextStyle(
color: const Color.fromARGB(255, 255, 255, 255),
fontSize: 20),
),
onTap: () {
// _abrirIMC();
},
),
ListTile(
leading: Icon(
Icons.settings,
color: const Color.fromARGB(255, 255, 255, 255),
),
title: Text(
"Configurações",
style: TextStyle(
color: const Color.fromARGB(255, 255, 255, 255),
fontSize: 20),
),
onTap: () {
//_abrirManu();
},
)
],
),
),
backgroundColor: Color.fromRGBO(0, 0, 0, 1),
appBar: AppBar(
centerTitle: true,
backgroundColor: Color.fromARGB(255, 255, 0, 0),
title: Text("TIGER FIT - GYM", style: TextStyle(fontSize: 25)),
),
body: Center(
child: PageView(
controller: controller,
onPageChanged: (index) {
setState(() => pagina = index);
},
children: <Widget>[
Container(
padding: EdgeInsets.all(16),
color: Colors.black,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
SizedBox(height: 16),
Text(
"Bem-vindo(a) a Tiger Fit!",
style: TextStyle(
color: Colors.white,
fontSize: 24,
fontWeight: FontWeight.bold,
),
textAlign: TextAlign.center,
),
SizedBox(height: 16),
Text(
"Aqui você encontra tudo o que precisa para atingir seus objetivos de fitness e bem-estar. Temos uma grande variedade de equipamentos de última geração, treinadores qualificados e uma ampla variedade de aulas e programas de treinamento personalizados para ajudá-lo a alcançar seus objetivos.",
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
textAlign: TextAlign.justify,
),
SizedBox(height: 16),
ElevatedButton(
onPressed: () {},
child: Text(
"AGENDE UMA VISITA",
style: TextStyle(fontSize: 16),
),
style: ElevatedButton.styleFrom(
backgroundColor: Color.fromARGB(255, 255, 0, 0),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(24.0),
),
padding: EdgeInsets.symmetric(
vertical: 16.0,
horizontal: 32.0,
),
),
),
SizedBox(height: 16),
Image.asset(
"images/gym.jpg",
width: MediaQuery.of(context).size.width * 0.9,
height: MediaQuery.of(context).size.height * 0.4,
fit: BoxFit.cover,
),
],
),
),
Container(
padding: EdgeInsets.all(16),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Text(
'CONFIRA OS SEUS TREINOS',
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 24,
fontWeight: FontWeight.bold,
color: Colors.white,
),
),
SizedBox(height: 25),
Expanded(
child: ListView(
children: [
_buildTreino(
'Treino de Abdominais',
'images/treino_abdominais.jpg',
),
SizedBox(height: 16),
_buildTreino(
'Treino de Pernas',
'images/treino_pernas.jpg',
),
SizedBox(height: 16),
_buildTreino(
'Treino de Peito e Costas',
'images/treino_peito_costas.jpg',
),
SizedBox(height: 16),
_buildTreino(
'Treino de Braços',
'images/treino_bracos.jpg',
),
SizedBox(height: 16),
_buildTreino(
'Treino de Panturrilha',
'images/treino_panturrilha.jpg',
),
SizedBox(height: 16),
_buildTreino(
'Treino de Agachamentos',
'images/treino_agachamento.jpg',
),
SizedBox(height: 16),
_buildTreino(
'Treinos Aeróbicos',
'images/treino_aerobicos.jpg',
),
],
),
),
],
),
),
SingleChildScrollView(
child: Form(
key: formkey,
child: Column(
children: [
Padding(padding: EdgeInsets.only(left: 200.0, top: 12.5)),
Text('INFORME SEUS DADOS',
style: TextStyle(
color: Color.fromARGB(255, 255, 0, 0),
fontSize: 30,
fontWeight: FontWeight.bold)),
SizedBox(height: 25),
Icon(
Icons.monitor_weight_outlined,
size: 80,
color: Color.fromARGB(255, 255, 0, 0),
),
SizedBox(height: 30),
TextFormField(
keyboardType: TextInputType.number,
decoration: InputDecoration(
prefixIcon: Icon(
Icons.person,
size: 30,
color: Color.fromARGB(255, 255, 0, 0),
),
contentPadding: EdgeInsets.fromLTRB(5, 0, 10, 0),
labelText: "Peso (Kg)",
labelStyle: TextStyle(
color: Colors.white,
fontSize: 25,
fontWeight: FontWeight.bold)),
textAlign: TextAlign.center,
style: TextStyle(color: Colors.white, fontSize: 25),
controller: pesoController,
validator: (value) {
if (value == null || value.isEmpty) {
return 'Insira seu Peso';
}
return null;
},
),
SizedBox(height: 75),
TextFormField(
keyboardType: TextInputType.number,
decoration: InputDecoration(
prefixIcon: Icon(
Icons.straight_outlined,
size: 30,
color: Color.fromARGB(255, 255, 0, 0),
),
contentPadding: EdgeInsets.fromLTRB(5, 0, 10, 0),
labelText: "Altura (Cm)",
labelStyle: TextStyle(
color: Colors.white,
fontSize: 25,
fontWeight: FontWeight.bold)),
textAlign: TextAlign.center,
style: TextStyle(color: Colors.white, fontSize: 25),
controller: alturaController,
validator: (value) {
if (value == null || value.isEmpty) {
return 'Insira sua Altura';
}
return null;
},
),
SizedBox(height: 80),
ElevatedButton(
onPressed: () {
if (formkey.currentState!.validate()) {
calcular();
}
},
child: Text('Calcular'),
style: ElevatedButton.styleFrom(
backgroundColor: Color.fromARGB(255, 255, 0, 0),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(50)),
textStyle: const TextStyle(
color: Colors.white, fontSize: 35),
)),
SizedBox(
height: 50,
),
Text(
info,
textAlign: TextAlign.center,
style: TextStyle(
color: Color.fromARGB(255, 255, 0, 0),
fontSize: 30,
),
)
],
),
),
),
SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Text(
'MINHA CONTA',
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 24,
fontWeight: FontWeight.bold,
color: Colors.white,
),
),
SizedBox(height: 25),
TextFormField(
keyboardType: TextInputType.emailAddress,
decoration: InputDecoration(
prefixIcon: Icon(Icons.email_outlined, color: Colors.white),
labelText: 'Email',
labelStyle: TextStyle(color: Colors.white)
),
controller: emailController,
validator: (value) {
if (value == null || value.isEmpty) {
return 'Insira seu email';
}
return null;
},
),
SizedBox(height: 16),
TextFormField(
obscureText: true,
decoration: InputDecoration(
prefixIcon: Icon(Icons.lock_outline, color: Colors.white),
labelText: 'Senha',
labelStyle: TextStyle(color: Colors.white)
),
controller: senhaController,
validator: (value) {
if (value == null || value.isEmpty) {
return 'Insira sua senha';
}
return null;
},
),
SizedBox(height: 16),
ElevatedButton(
onPressed: () {},
child: Text('ENTRAR'),
),
],
),
),
)
],
),
),
bottomNavigationBar: BottomNavyBar(
containerHeight: 60,
iconSize: 30,
backgroundColor: Colors.black,
selectedIndex: pagina,
showElevation: true,
itemCornerRadius: 24,
curve: Curves.easeIn,
onItemSelected: (index) {
setState(() => pagina = index);
controller.jumpToPage(index);
},
items: <BottomNavyBarItem>[
BottomNavyBarItem(
inactiveColor: Colors.white,
icon: Icon(Icons.home_outlined),
title: Text('HOME',
style: TextStyle(color: Color.fromARGB(255, 255, 0, 0))),
activeColor: Color.fromARGB(255, 255, 0, 0),
textAlign: TextAlign.center,
),
BottomNavyBarItem(
inactiveColor: Colors.white,
icon: Icon(Icons.fitness_center_outlined),
title: Text('TREINOS',
style: TextStyle(color: Color.fromARGB(255, 255, 0, 0))),
activeColor: Color.fromARGB(255, 255, 0, 0),
textAlign: TextAlign.center,
),
BottomNavyBarItem(
inactiveColor: Colors.white,
icon: Icon(Icons.accessibility_new_outlined),
title: Text('IMC',
style: TextStyle(color: Color.fromARGB(255, 255, 0, 0))),
activeColor: Color.fromARGB(255, 255, 0, 0),
textAlign: TextAlign.center,
),
BottomNavyBarItem(
inactiveColor: Colors.white,
icon: Icon(Icons.account_circle_outlined),
title: Text('USUÁRIO',
style: TextStyle(color: Color.fromARGB(255, 255, 0, 0))),
activeColor: Color.fromARGB(255, 255, 0, 0),
textAlign: TextAlign.center,
),
],
),
);
}
}
| 0
|
mirrored_repositories/App-TigerFit
|
mirrored_repositories/App-TigerFit/test/widget_test.dart
|
// This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility in the flutter_test package. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:tigerfit/views/home.dart';
void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(const Home());
// Verify that our counter starts at 0.
expect(find.text('0'), findsOneWidget);
expect(find.text('1'), findsNothing);
// Tap the '+' icon and trigger a frame.
await tester.tap(find.byIcon(Icons.add));
await tester.pump();
// Verify that our counter has incremented.
expect(find.text('0'), findsNothing);
expect(find.text('1'), findsOneWidget);
});
}
| 0
|
mirrored_repositories/envify_demo
|
mirrored_repositories/envify_demo/lib/main.dart
|
import 'package:envify_demo/page/envify_demo.dart';
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Envify Demo',
debugShowCheckedModeBanner: false,
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: Scaffold(
appBar: AppBar(
title: const Text('Envify Demo Page'),
),
body: const EnvifyDemo(),
));
}
}
| 0
|
mirrored_repositories/envify_demo/lib
|
mirrored_repositories/envify_demo/lib/page/envify_demo.dart
|
import 'package:envify_demo/config/env.dart';
import 'package:flutter/material.dart';
class EnvifyDemo extends StatelessWidget {
const EnvifyDemo({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return SingleChildScrollView(
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
SelectableText.rich(
TextSpan(
text: 'My name is ',
style: Theme.of(context).textTheme.headline1,
children: const <TextSpan>[
TextSpan(
text: Secret.client_id,
style: TextStyle(
color: Colors.red,
decoration: TextDecoration.underline,
)),
TextSpan(text: '.')
],
),
),
const SizedBox(
height: 10,
),
SelectableText.rich(
TextSpan(
text: 'I type ',
style: Theme.of(context).textTheme.headline2,
children: const <TextSpan>[
TextSpan(
text: Secret.client_secret,
style: TextStyle(
color: Colors.green,
decoration: TextDecoration.underline,
)),
TextSpan(
text: ' as my secret password.',
),
],
),
),
const SizedBox(
height: 10,
),
SelectableText.rich(
TextSpan(
text: 'The API Key assigned to me is ',
style: Theme.of(context).textTheme.headline3,
children: const <TextSpan>[
TextSpan(
text: Secret.api_key,
style: TextStyle(
color: Colors.blue,
decoration: TextDecoration.underline,
)),
TextSpan(text: '.')
],
),
),
const SizedBox(
height: 10,
),
SelectableText.rich(
TextSpan(
text: "Psst! Don't Tell Anyone, ",
style: Theme.of(context).textTheme.headline4,
children: const <TextSpan>[
TextSpan(
text: Secret.site_key,
style: TextStyle(
color: Colors.purple,
decoration: TextDecoration.underline,
)),
TextSpan(text: ' is my site key.')
],
),
),
],
),
),
);
}
}
| 0
|
mirrored_repositories/envify_demo
|
mirrored_repositories/envify_demo/test/widget_test.dart
|
// This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility that Flutter provides. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:envify_demo/main.dart';
void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(const MyApp());
// Verify that our counter starts at 0.
expect(find.text('0'), findsOneWidget);
expect(find.text('1'), findsNothing);
// Tap the '+' icon and trigger a frame.
await tester.tap(find.byIcon(Icons.add));
await tester.pump();
// Verify that our counter has incremented.
expect(find.text('0'), findsNothing);
expect(find.text('1'), findsOneWidget);
});
}
| 0
|
mirrored_repositories/grounduity
|
mirrored_repositories/grounduity/lib/resultcolumn.dart
|
import 'package:flutter/material.dart';
class ResultColumn extends StatelessWidget {
ResultColumn({Key key, this.title, this.value});
String title;
String value;
@override
Widget build(BuildContext context) {
return new Container(
margin: EdgeInsets.all(40.0),
child: new Column(
children: <Widget>[
new Text(
title,
maxLines: 1,
textScaleFactor: 1.0,
style: TextStyle(color: Theme.of(context).accentColor),
),
new Text(
value,
maxLines: 1,
textScaleFactor: 1.75,
),
],
),
);
}
}
| 0
|
mirrored_repositories/grounduity
|
mirrored_repositories/grounduity/lib/main.dart
|
import 'package:flutter/material.dart';
import 'buttoncolumn.dart';
import 'resultcolumn.dart';
import 'dart:async';
import 'dart:core';
void main() => runApp(new MyApp());
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => new _MyAppState();
}
class _MyAppState extends State<MyApp> {
double _billAmount = 0.0;
double _tipTier1 = 10.0;
double _tipTier2 = 15.0;
double _tipTier3 = 20.0;
double _tipPercentage = 15.0;
String _monetarySymbol = "\$";
final appName = 'Grounduity';
double calculateTotal(double total, double tip) {
return (total * (1 + tip / 100)).ceilToDouble();
}
String calculateTip(double previousTotal, double newTotal) {
var result = newTotal - previousTotal;
return result.toStringAsPrecision(3);
}
Future<void> _changeTierValue(context, _tipValue) async {
num _returnValue;
return showDialog<void>(
context: context,
barrierDismissible: false, // user must tap button!
builder: (BuildContext context) {
return new AlertDialog(
title: new Text('Update tip value'),
content: new TextField(
keyboardType: TextInputType.number,
autofocus: true,
decoration: new InputDecoration(
suffixText: '%',
labelText: "Percentage value",
labelStyle: TextStyle(fontSize: 25.0),
hintText: "10",
),
onChanged: (String value) {
try {
_returnValue = num.parse(value);
} catch (exception) {
_returnValue = 0.0;
}
}),
actions: <Widget>[
new FlatButton(
child: new Text('Update'),
onPressed: () {
setState(() {
_tipValue = _returnValue.toDouble();
});
Navigator.of(context).pop();
},
),
],
);
},
);
}
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: 'Grounduity',
theme: new ThemeData(
primarySwatch: Colors.green, accentColor: Colors.greenAccent),
home: new Scaffold(
appBar: new AppBar(
title: Text(appName),
),
body: new Center(
child: new Column(
children: <Widget>[
new Container(
margin: EdgeInsets.all(20.0),
padding: EdgeInsets.symmetric(horizontal: 10.0),
child: new TextField(
keyboardType: TextInputType.number,
autofocus: true,
decoration: new InputDecoration(
prefixText: _monetarySymbol,
labelText: "Bill before gratuity",
labelStyle: TextStyle(fontSize: 25.0),
hintText: '10',
),
onChanged: (String value) {
try {
_billAmount = double.parse(value);
} catch (exception) {
_billAmount = 0.0;
}
},
)),
new Row(
children: <Widget>[
new ButtonColumn(
icon: Icons.star_border,
value: _tipTier1,
groupValue: _tipPercentage,
onChanged: (double value) {
setState(() {
_tipPercentage = value;
});
},
onTierChanged: (context) => _changeTierValue(context,_tipTier1)),
new ButtonColumn(
icon: Icons.star_half,
value: _tipTier2,
groupValue: _tipPercentage,
onChanged: (double value) {
setState(() {
_tipPercentage = value;
});
},
onTierChanged: (context) => _changeTierValue(context,_tipTier2)),
new ButtonColumn(
icon: Icons.star,
value: _tipTier3,
groupValue: _tipPercentage,
onChanged: (double value) {
setState(() {
_tipPercentage = value;
});
},
onTierChanged: (context) => _changeTierValue(context,_tipTier3),
)
],
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
),
new Row(
children: <Widget>[
ResultColumn(
title: "Tip",
value: _monetarySymbol +
calculateTip(_billAmount,
calculateTotal(_billAmount, _tipPercentage))),
ResultColumn(
title: "Total",
value: _monetarySymbol +
calculateTotal(_billAmount, _tipPercentage)
.toStringAsPrecision(3))
],
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
)
],
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
),
),
));
}
}
| 0
|
mirrored_repositories/grounduity
|
mirrored_repositories/grounduity/lib/buttoncolumn.dart
|
import 'package:flutter/material.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/widgets.dart';
import 'dart:core';
import 'dart:async';
typedef FutureValueChanged = Future<void> Function(BuildContext context);
class ButtonColumn<double> extends StatefulWidget {
ButtonColumn(
{Key key,
@required this.icon,
@required this.value,
@required this.groupValue,
@required this.onChanged,
@required this.onTierChanged})
: super(key: key);
final IconData icon;
double value;
final double groupValue;
final ValueChanged<double> onChanged;
final FutureValueChanged onTierChanged;
Color activeColor;
@override
_ButtonColumnState<double> createState() => new _ButtonColumnState<double>();
}
class _ButtonColumnState<double> extends State<ButtonColumn<double>> {
Color _getInactiveColor(ThemeData themeData, bool selected) {
return selected ? themeData.unselectedWidgetColor : themeData.disabledColor;
}
void _handleChanged() {
widget.onChanged(widget.value);
}
Null _handleTierChanged(BuildContext context) {
widget.onTierChanged(context);
return null;
}
@override
Widget build(BuildContext context) {
bool selected = widget.groupValue == widget.value;
return new GestureDetector(
onTap: () {
setState(() {
_handleChanged();
});
},
onLongPress: () => _handleTierChanged(context),
child: new Container(
child: new Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: [
new Container(
margin: EdgeInsets.only(top: 20.0),
child: new Icon(
widget.icon,
color: selected
? _getInactiveColor(Theme.of(context), selected)
: widget.activeColor ?? Theme.of(context).accentColor,
size: 40.0,
),
),
new Container(
margin: const EdgeInsets.only(top: 7.0),
child: new Text(
widget.value.toString() + '%',
style: new TextStyle(
fontSize: 20.0,
fontWeight: FontWeight.w400,
color: selected
? _getInactiveColor(Theme.of(context), selected)
: widget.activeColor ?? Theme.of(context).accentColor,
),
),
),
],
),
),
);
}
}
| 0
|
mirrored_repositories/grounduity
|
mirrored_repositories/grounduity/test/widget_test.dart
|
// This is a basic Flutter widget test.
// To perform an interaction with a widget in your test, use the WidgetTester utility that Flutter
// provides. For example, you can send tap and scroll gestures. You can also use WidgetTester to
// find child widgets in the widget tree, read text, and verify that the values of widget properties
// are correct.
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:grounduity/main.dart';
void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(new MyApp());
// Verify that our counter starts at 0.
expect(find.text('0'), findsOneWidget);
expect(find.text('1'), findsNothing);
// Tap the '+' icon and trigger a frame.
await tester.tap(find.byIcon(Icons.add));
await tester.pump();
// Verify that our counter has incremented.
expect(find.text('0'), findsNothing);
expect(find.text('1'), findsOneWidget);
});
}
| 0
|
mirrored_repositories/InstaMojo-Payment-App
|
mirrored_repositories/InstaMojo-Payment-App/lib/main.dart
|
import 'package:flutter/material.dart';
import 'package:folk_payments/screens/login_screen.dart';
import 'package:folk_payments/screens/categories.dart';
import 'package:folk_payments/screens/instamojo.dart';
import 'package:folk_payments/screens/products.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Folk Payments',
theme: ThemeData.light().copyWith(
appBarTheme: AppBarTheme(
color: Colors.black,
),
),
routes: {
LoginScreen.routeName: (context) => LoginScreen(),
Categories.routeName: (context) => Categories(),
InstaMojo.routeName: (context) => InstaMojo(),
Products.routeName: (context) => Products(),
},
initialRoute: LoginScreen.routeName,
);
}
}
| 0
|
mirrored_repositories/InstaMojo-Payment-App/lib
|
mirrored_repositories/InstaMojo-Payment-App/lib/utilities/constants.dart
|
import 'package:flutter/material.dart';
const kInputBoxColor = Colors.white;
const kButtonColor = Colors.white;
const kRedColor = Color(0xFFEA4235);
const kYellowColor = Color(0xFFFABC05);
const kGreenColor = Color(0xFF34A853);
const kBlueColor = Color(0xFF4286F5);
const kInputBoxStyle = TextStyle(
fontSize: 20.0,
fontWeight: FontWeight.w500,
letterSpacing: 2.5,
);
const kInputBoxInputTextStyle = TextStyle(
fontSize: 24.0,
fontWeight: FontWeight.w400,
letterSpacing: 2.5,
color: Colors.black,
);
| 0
|
mirrored_repositories/InstaMojo-Payment-App/lib
|
mirrored_repositories/InstaMojo-Payment-App/lib/utilities/items.dart
|
List cat1 = [
{"item_name": "Radha Krishna Wall Hanging |Radha Krishna Jhula Wall Hanging for Home Decor", "item_url": "https://m.media-amazon.com/images/I/71TmSRkmAEL._AC_UL320_ML3_.jpg", "item_price": "799"},
{"item_name": "Fabzone Brown Antique Look Lord Ganesha God OM Ganesh Ganpati Idol Statue Wall Hanging Showpiece Figurine", "item_url": "https://m.media-amazon.com/images/I/71d8VOc22PL._AC_UL320_ML3_.jpg", "item_price": "599"},
{"item_name": "Crafthut Handmade Brass Material Statue of Lord Radha Krishna Seating on Jhoola/Swing", "item_url": "https://m.media-amazon.com/images/I/71rHTeqk2AL._AC_UL320_ML3_.jpg", "item_price": "1,499"},
{"item_name": "ISKCON Jagannath JAAP MALA for Pooja-Astrology-108+1 Beads and Certified Small Size", "item_url": "https://m.media-amazon.com/images/I/41XLJJ9XKsL._AC_UL320_ML3_.jpg", "item_price": "108"},
{"item_name": "ISKCON Jagannath Tulsi Bead Triple Layer Kanthi Mala for Neck", "item_url": "https://m.media-amazon.com/images/I/91qX4o7A5lL._AC_UL320_ML3_.jpg", "item_price": "198"},
{"item_name": "KRISHNA:Devadi_Devudu Sri Krishna Bhagavanudu (Hardcover, Telugu, His Divine Grace A.C. Bhaktivedanta Swami Prabhupada)", "item_url": "https://m.media-amazon.com/images/I/513sosXGijL._AC_UL320_ML3_.jpg", "item_price": "349"},
{"item_name": "In Vaikuntha Not Even The Leaves Fall: A Treatise On The Bondage Of The Jiva", "item_url": "https://m.media-amazon.com/images/I/71nyvDru6EL._AC_UL320_ML3_.jpg", "item_price": "0"},
{"item_name": "Arcana, Volume 2: The ISKCON Deity Worship Journal", "item_url": "https://m.media-amazon.com/images/I/81jNGxJW9YL._AC_UL320_ML3_.jpg", "item_price": "0"},
{"item_name": "Original Bhagavad Gita (Small Size) \u2014 Dual Color Print", "item_url": "https://m.media-amazon.com/images/I/81FC5v9M0jL._AC_UL320_ML3_.jpg", "item_price": "399"},
{"item_name": "Radha Krishna Wall Hanging |Radha Krishna Jhula Wall Hanging for Home Decor", "item_url": "https://m.media-amazon.com/images/I/71TmSRkmAEL._AC_UL320_ML3_.jpg", "item_price": "799"},
{"item_name": "Fabzone Brown Antique Look Lord Ganesha God OM Ganesh Ganpati Idol Statue Wall Hanging Showpiece Figurine", "item_url": "https://m.media-amazon.com/images/I/71d8VOc22PL._AC_UL320_ML3_.jpg", "item_price": "599"},
{"item_name": "Crafthut Handmade Brass Material Statue of Lord Radha Krishna Seating on Jhoola/Swing", "item_url": "https://m.media-amazon.com/images/I/71rHTeqk2AL._AC_UL320_ML3_.jpg", "item_price": "1,499"},
{"item_name": "The Gita", "item_url": "https://m.media-amazon.com/images/I/61NJ0cIFsfL._AC_UL320_ML3_.jpg", "item_price": "0"},
{"item_name": "ISKCON Jagannath Dashavatara Fine Art Paper Print Poster", "item_url": "https://m.media-amazon.com/images/I/612AqGdJ+2L._AC_UL320_ML3_.jpg", "item_price": "108"},
{"item_name": "ISKCON Jagannath Metal Lord Shree Krishna Pendant for Men and Women", "item_url": "https://m.media-amazon.com/images/I/518CSiugatL._AC_UL320_ML3_.jpg", "item_price": "108"},
{"item_name": "Prabhupada: Messenger of the Supreme Lord [Biography of Srila Prabhupada, the founder Acarya of ISKCON]", "item_url": "https://m.media-amazon.com/images/I/51pjwZedJ4L._AC_UL320_ML3_.jpg", "item_price": "130"},
{"item_name": "Lord krishna's 46 in 1 Gayatri Mantra Hare Krishna (Iskcon Voice) Mini Plug Chanting Machine Box for Pooja Room", "item_url": "https://m.media-amazon.com/images/I/61CBIqOgLwL._AC_UL320_ML3_.jpg", "item_price": "299"},
{"item_name": "The Four Vedas Mantras Digital Audio CD", "item_url": "https://m.media-amazon.com/images/I/910fVVoRWLL._AC_UL320_ML3_.jpg", "item_price": "108"},
{"item_name": "Shrimad Bhagwat Geeta: Religion Books (1) (Gujarati Edition)", "item_url": "https://m.media-amazon.com/images/I/71MdPaStTRL._AC_UL320_ML3_.jpg", "item_price": "0"},
{"item_name": "Krishna / Krsna Supreme Personality of Godhead in Telugu - Hard Bound by HDG A.C. Bhaktivedanta Swami Prabhupada", "item_url": "https://m.media-amazon.com/images/I/A1LxgeyJmvL._AC_UL320_ML3_.jpg", "item_price": "108"},
{"item_name": "Bhagavad-Gita As it is (Tamil) World Most Read Edition", "item_url": "https://m.media-amazon.com/images/I/A1O706YyDmL._AC_UL320_ML3_.jpg", "item_price": "178"},
{"item_name": "Bhagavad Gita According to Gandhi: Collector's Edition - Gilded and Hardbound - Original Unabridged Translation of the Sanskrit Text by Mahatma Gandhi (Quignog Collectibles)", "item_url": "https://m.media-amazon.com/images/I/71FVx7Y+i1L._AC_UL320_ML3_.jpg", "item_price": "299"},
{"item_name": "I Jewels Traditional Gold Plated Kundan Pearl Choker Necklace Set Earrings & Maang Tikka for Women (IJ325G)", "item_url": "https://m.media-amazon.com/images/I/71o1mBei1hL._AC_UL320_ML3_.jpg", "item_price": "1,105"},
{"item_name": "VRINDAVANBAZAAR Liquid Chandan Gopi Tilak (White)", "item_url": "https://m.media-amazon.com/images/I/41XwBMCuF5L._AC_UL320_ML3_.jpg", "item_price": "110"},
{"item_name": "Radha Krishna Wall Hanging |Radha Krishna Jhula Wall Hanging for Home Decor", "item_url": "https://m.media-amazon.com/images/I/71TmSRkmAEL._AC_UL320_ML3_.jpg", "item_price": "799"},
{"item_name": "Fabzone Brown Antique Look Lord Ganesha God OM Ganesh Ganpati Idol Statue Wall Hanging Showpiece Figurine", "item_url": "https://m.media-amazon.com/images/I/71d8VOc22PL._AC_UL320_ML3_.jpg", "item_price": "599"},
{"item_name": "Crafthut Handmade Brass Material Statue of Lord Radha Krishna Seating on Jhoola/Swing", "item_url": "https://m.media-amazon.com/images/I/71rHTeqk2AL._AC_UL320_ML3_.jpg", "item_price": "1,499"},
{"item_name": "ISKCON Jagannath Tulsi Bead Triple Layer Kanthi Mala for Neck", "item_url": "https://m.media-amazon.com/images/I/91qX4o7A5lL._AC_UL320_ML3_.jpg", "item_price": "198"},
{"item_name": "Krsna Pastimes Colouring Book", "item_url": "https://m.media-amazon.com/images/I/51jXgv4NSIL._AC_UL320_ML3_.jpg", "item_price": "165"},
{"item_name": "Life's Amazing Secrets (Hindi): Jeevan Ke Adbhut Rahasya", "item_url": "https://m.media-amazon.com/images/I/71c96eeGwjL._AC_UL320_ML3_.jpg", "item_price": "97"},
{"item_name": "Bhagavad Gita As It Is Macmillan-Original Edition", "item_url": "https://m.media-amazon.com/images/I/81raGIB2zLL._AC_UL320_ML3_.jpg", "item_price": "255"},
{"item_name": "A Comprehensive Guide to Bhagavad-Gita with Literal Translation", "item_url": "https://m.media-amazon.com/images/I/71ZUJA9lepL._AC_UL320_ML3_.jpg", "item_price": "490"},
{"item_name": "ISKCON Jagannath Bbt Murali Krishna Fine Art Print Poster (Paper, Multicolour)", "item_url": "https://m.media-amazon.com/images/I/61Y5-PgkdGL._AC_UL320_ML3_.jpg", "item_price": "108"},
{"item_name": "ISKCON Jagannath Certified Copper or Tamba Ring Adjustable and Flexible Size for Men and Women", "item_url": "https://m.media-amazon.com/images/I/61C4hI37+rL._AC_UL320_ML3_.jpg", "item_price": "108"},
{"item_name": "ISKCON Jagannath 1 Round Multicolour Wooden Bead Single Layer Kanthi Mala Necklace (43.18 cm)", "item_url": "https://m.media-amazon.com/images/I/61-oPNjQOwL._AC_UL320_ML3_.jpg", "item_price": "108"},
{"item_name": "The Bhagavad Gita: Chapters 1-13", "item_url": "https://m.media-amazon.com/images/I/713GvsYZGsL._AC_UL320_ML3_.jpg", "item_price": "0"},
{"item_name": "Bhagavad-Gita (Hindi)", "item_url": "https://m.media-amazon.com/images/I/71sEb27W4rL._AC_UL320_ML3_.jpg", "item_price": "122"},
{"item_name": "ISKCON Jagannath Bhagavad-Gita As It is Telugu Hardcover (0.5 x 5.4 x 8.4cm, Multicolour)", "item_url": "https://m.media-amazon.com/images/I/71lKUGZPQtL._AC_UL320_ML3_.jpg", "item_price": "108"},
{"item_name": "ISKCON Jagannath Dashavatara Fine Art Paper Print Poster", "item_url": "https://m.media-amazon.com/images/I/612AqGdJ+2L._AC_UL320_ML3_.jpg", "item_price": "108"},
];
List cat2 = [
{"item_name": "In Vaikuntha Not Even The Leaves Fall: A Treatise On The Bondage Of The Jiva", "item_url": "https://m.media-amazon.com/images/I/71nyvDru6EL._AC_UL320_ML3_.jpg", "item_price": "0"},
{"item_name": "Arcana, Volume 2: The ISKCON Deity Worship Journal", "item_url": "https://m.media-amazon.com/images/I/81jNGxJW9YL._AC_UL320_ML3_.jpg", "item_price": "0"},
{"item_name": "Lord krishna's 46 in 1 Gayatri Mantra Hare Krishna (Iskcon Voice) Mini Plug Chanting Machine Box for Pooja Room", "item_url": "https://m.media-amazon.com/images/I/61CBIqOgLwL._AC_UL320_ML3_.jpg", "item_price": "299"},
{"item_name": "The Four Vedas Mantras Digital Audio CD", "item_url": "https://m.media-amazon.com/images/I/910fVVoRWLL._AC_UL320_ML3_.jpg", "item_price": "108"},
{"item_name": "bhagavad gita (oriya)", "item_url": "https://m.media-amazon.com/images/I/61yNGq7tWoL._AC_UL320_ML3_.jpg", "item_price": "295"},
{"item_name": "ALCiS Men's Round Neck Synthetic T-Shirt", "item_url": "https://m.media-amazon.com/images/I/81IdDHpUMGL._AC_UL320_ML3_.jpg", "item_price": "279"},
{"item_name": "ISKCON Jagannath Krishna Dances over Kaliya Snake Hood Fine Art Paper Print Poster (Multicolour, 19.5 x 13.5 inches)", "item_url": "https://m.media-amazon.com/images/I/71VRGAa0wGL._AC_UL320_ML3_.jpg", "item_price": "108"},
{"item_name": "Kingston 8 GB microSDHC Class 4 Flash Memory Card SDC4/8GB CO8G Taiwan", "item_url": "https://m.media-amazon.com/images/I/61qcFt4D2SL._AC_UL320_ML3_.jpg", "item_price": "108"},
{"item_name": "Reflections on Sacred Teachings IV: Sri Isopanisad", "item_url": "https://m.media-amazon.com/images/I/51RvI7m+K2L._AC_UL320_ML3_.jpg", "item_price": "0"},
{"item_name": "Valmiki Ramayanam", "item_url": "https://m.media-amazon.com/images/I/71e1hUBbr6L._AC_UL320_ML3_.jpg", "item_price": "250"},
{"item_name": "God Talks with Arjuna: The Bhagavad Gita (Slipcased)", "item_url": "https://m.media-amazon.com/images/I/51N5ghz0izL._AC_UL320_ML3_.jpg", "item_price": "605"},
{"item_name": "Bhagavad-gita As It Is", "item_url": "https://m.media-amazon.com/images/I/81TXvt0QVeL._AC_UL320_ML3_.jpg", "item_price": "257"},
{"item_name": "Ramayana of Valmiki-English Edition Paperback \u2013 2014", "item_url": "https://m.media-amazon.com/images/I/41509vgMNbL._AC_UL320_ML3_.jpg", "item_price": "165"},
{"item_name": "KRISHNA:Devadi_Devudu Sri Krishna Bhagavanudu (Hardcover, Telugu, His Divine Grace A.C. Bhaktivedanta Swami Prabhupada)", "item_url": "https://m.media-amazon.com/images/I/513sosXGijL._AC_UL320_ML3_.jpg", "item_price": "349"},
{"item_name": "Bhagavad Gita As It is Hindi by His Divine Grace A.C.Bhaktivedanta Swami Srila Prabhupada", "item_url": "https://m.media-amazon.com/images/I/51esXLpRisL._AC_UL320_ML3_.jpg", "item_price": "108"},
{"item_name": "Krsna Pastimes Colouring Book", "item_url": "https://m.media-amazon.com/images/I/51jXgv4NSIL._AC_UL320_ML3_.jpg", "item_price": "165"},
{"item_name": "Original Bhagavad Gita (Small Size) \u2014 Dual Color Print", "item_url": "https://m.media-amazon.com/images/I/81FC5v9M0jL._AC_UL320_ML3_.jpg", "item_price": "399"},
{"item_name": "Shrimad Bhagwat Geeta: Religion Books (1) (Gujarati Edition)", "item_url": "https://m.media-amazon.com/images/I/71MdPaStTRL._AC_UL320_ML3_.jpg", "item_price": "0"},
{"item_name": "Prabhupada: Messenger of the Supreme Lord [Biography of Srila Prabhupada, the founder Acarya of ISKCON]", "item_url": "https://m.media-amazon.com/images/I/51pjwZedJ4L._AC_UL320_ML3_.jpg", "item_price": "130"},
{"item_name": "Sai Amrut Antique Marble Finish Lord Radha Krishna Statue/Idol 7inch", "item_url": "https://m.media-amazon.com/images/I/81WHZmeDwaL._AC_UL320_ML3_.jpg", "item_price": "899"},
{"item_name": "ISKCON Jagannath Red Silver Plated Lord Jagannath Pendant/Locket for Men and Women", "item_url": "https://m.media-amazon.com/images/I/41QqC+CcTNL._AC_UL320_ML3_.jpg", "item_price": "108"},
{"item_name": "Krishna Playing Flute Fun Spring -VRINDAVANBAZAAR.COM", "item_url": "https://m.media-amazon.com/images/I/61iriQYOQvL._AC_UL320_ML3_.jpg", "item_price": "200"},
{"item_name": "Lord krishna's Plastic 46in1 Gayatri Mantra Chanting Box Machine Music Box", "item_url": "https://m.media-amazon.com/images/I/61foqIlQtoL._AC_UL320_ML3_.jpg", "item_price": "399"},
{"item_name": "God's Own Kitchen: The Inspiring Story of Akshaya Patra - A Social Enterprise Run by Monks and CEOs", "item_url": "https://m.media-amazon.com/images/I/51Mp1nshX9L._AC_UL320_ML3_.jpg", "item_price": "207"},
{"item_name": "Gauranga - The golden incarnation of divine love", "item_url": "https://m.media-amazon.com/images/I/51zC3op0HgL._AC_UL320_ML3_.jpg", "item_price": "0"},
{"item_name": "Swami in a Strange Land: How Krishna Came to the West", "item_url": "https://m.media-amazon.com/images/I/71Yg566N5sL._AC_UL320_ML3_.jpg", "item_price": "333"},
{"item_name": "The Teaching of the Bhagavad Gita", "item_url": "https://m.media-amazon.com/images/I/8179cCxWCcL._AC_UL320_ML3_.jpg", "item_price": "224"},
{"item_name": "My Gita", "item_url": "https://m.media-amazon.com/images/I/71R1VMOZr8L._AC_UL320_ML3_.jpg", "item_price": "168"},
{"item_name": "ISKCON Jagannath Bbt Murali Krishna Fine Art Print Poster (Paper, Multicolour)", "item_url": "https://m.media-amazon.com/images/I/61Y5-PgkdGL._AC_UL320_ML3_.jpg", "item_price": "108"},
{"item_name": "Kingston 8 GB microSDHC Class 4 Flash Memory Card SDC4/8GB CO8G Taiwan", "item_url": "https://m.media-amazon.com/images/I/61qcFt4D2SL._AC_UL320_ML3_.jpg", "item_price": "108"},
{"item_name": "ALCiS Women's Asymmetric Vest Top", "item_url": "https://m.media-amazon.com/images/I/813kBAsfQLL._AC_UL320_ML3_.jpg", "item_price": "251"},
{"item_name": "ISKCON Jagannath Krishna Dances over Kaliya Snake Hood Fine Art Paper Print Poster (Multicolour, 19.5 x 13.5 inches)", "item_url": "https://m.media-amazon.com/images/I/71VRGAa0wGL._AC_UL320_ML3_.jpg", "item_price": "108"},
{"item_name": "Life's Amazing Secrets (Hindi): Jeevan Ke Adbhut Rahasya", "item_url": "https://m.media-amazon.com/images/I/71c96eeGwjL._AC_UL320_ML3_.jpg", "item_price": "97"},
{"item_name": "Bhagavad Gita As It Is Macmillan-Original Edition", "item_url": "https://m.media-amazon.com/images/I/81raGIB2zLL._AC_UL320_ML3_.jpg", "item_price": "255"},
{"item_name": "Easy Journey to Other Planets", "item_url": "https://m.media-amazon.com/images/I/51Y5R51TDYL._AC_UL320_ML3_.jpg", "item_price": "64"},
{"item_name": "Bhagavad Gita As It Is -Pocket Size", "item_url": "https://m.media-amazon.com/images/I/81qwP0egX4L._AC_UL320_ML3_.jpg", "item_price": "108"},
{"item_name": "The Scientific Basis", "item_url": "https://m.media-amazon.com/images/I/811XYk7ZO9L._AC_UL320_ML3_.jpg", "item_price": "110"},
{"item_name": "Sri Namastaka of Srila Rupa Gosvami Prabhupada", "item_url": "https://m.media-amazon.com/images/I/91mYBtca7ML._AC_UL320_ML3_.jpg", "item_price": "150"},
{"item_name": "A Beginner's Guide to Krishna Consciousness", "item_url": "https://m.media-amazon.com/images/I/91uZrMiutPL._AC_UL320_ML3_.jpg", "item_price": "108"},
];
List cat3 = [
{"item_name": "Krishna, The Reservoir of Pleasure", "item_url": "https://m.media-amazon.com/images/I/51-mzzx0H5L._AC_UL320_ML3_.jpg", "item_price": "51"},
{"item_name": "Arcana, Volume 1: The ISKCON Deity Worship Journal", "item_url": "https://m.media-amazon.com/images/I/81JKREQtRTL._AC_UL320_ML3_.jpg", "item_price": "0"},
{"item_name": "The Final Order: Proves Srila Prabhupada is ISKCON's Initiating Guru", "item_url": "https://m.media-amazon.com/images/I/9166l7++VSL._AC_UL320_ML3_.jpg", "item_price": "0"},
{"item_name": "ISKCON Jagannath Multicolour Tulsi Beads Triple Layer Kanthi Mala/Necklace", "item_url": "https://m.media-amazon.com/images/I/71NI1IMfOqL._AC_UL320_ML3_.jpg", "item_price": "195"},
{"item_name": "Bhagavad-Gita As it is (Telugu)", "item_url": "https://m.media-amazon.com/images/I/718fZcBNKlL._AC_UL320_ML3_.jpg", "item_price": "200"},
{"item_name": "Bhagavad Gita - Pure: A Comprehensive Study without Sectarian Contamination", "item_url": "https://m.media-amazon.com/images/I/71KIjx2gmML._AC_UL320_ML3_.jpg", "item_price": "51"},
{"item_name": "ISKCON Jagannath Cotton Thread/Mouli/Lal Dhaga for Puja (Red) -1 Roll", "item_url": "https://m.media-amazon.com/images/I/31UtCeqS5EL._AC_UL320_ML3_.jpg", "item_price": "80"},
{"item_name": "A Comprehensive Guide to Bhagavad-Gita with Literal Translation", "item_url": "https://m.media-amazon.com/images/I/71ZUJA9lepL._AC_UL320_ML3_.jpg", "item_price": "490"},
{"item_name": "ISKCON Jagannath Certified Copper or Tamba Ring Adjustable and Flexible Size for Men and Women", "item_url": "https://m.media-amazon.com/images/I/61C4hI37+rL._AC_UL320_ML3_.jpg", "item_price": "108"},
{"item_name": "bhagavad gita (oriya)", "item_url": "https://m.media-amazon.com/images/I/61yNGq7tWoL._AC_UL320_ML3_.jpg", "item_price": "295"},
{"item_name": "Reflections on Sacred Teachings IV: Sri Isopanisad", "item_url": "https://m.media-amazon.com/images/I/51RvI7m+K2L._AC_UL320_ML3_.jpg", "item_price": "0"},
{"item_name": "Krishna Playing Flute Fun Spring -VRINDAVANBAZAAR.COM", "item_url": "https://m.media-amazon.com/images/I/61iriQYOQvL._AC_UL320_ML3_.jpg", "item_price": "200"},
{"item_name": "Lord krishna's Marathi 22 in 1 Digambara Digambara/Shree Swami Samarth/Gayatri Mantra/Maha Mantra (Iskcon Voice) Mini Plug Device Chanting Machine Box for Pooja Room", "item_url": "https://m.media-amazon.com/images/I/61pg6MXTRBL._AC_UL320_ML3_.jpg", "item_price": "219"},
{"item_name": "ISKCON Jagannath Divine Kala Black Moti for Men and Women", "item_url": "https://m.media-amazon.com/images/I/71KZqj5RSAL._AC_UL320_ML3_.jpg", "item_price": "108"},
{"item_name": "Bhagavad gita : Bio-Science and Psychology (Volume 2)", "item_url": "https://m.media-amazon.com/images/I/61n8nGy+gWL._AC_UL320_ML3_.jpg", "item_price": "499"},
{"item_name": "ALCiS Men's Round Neck Synthetic T-Shirt", "item_url": "https://m.media-amazon.com/images/I/81F8ywJjy5L._AC_UL320_ML3_.jpg", "item_price": "387"},
{"item_name": "Lord krishna's Plastic 46in1 Gayatri Mantra Chanting Box Machine Music Box", "item_url": "https://m.media-amazon.com/images/I/61foqIlQtoL._AC_UL320_ML3_.jpg", "item_price": "399"},
{"item_name": "Bhagavad Gita As It Is Macmillan-Original Edition", "item_url": "https://m.media-amazon.com/images/I/81raGIB2zLL._AC_UL320_ML3_.jpg", "item_price": "255"},
{"item_name": "Murali Krishna Blue Colour Deity/Statue / Murti/Idol", "item_url": "https://m.media-amazon.com/images/I/61OUrfbFNAL._AC_UL320_ML3_.jpg", "item_price": "108"},
{"item_name": "AEON METAL STICKER 3D Plastic Night Lamp, Multicolour", "item_url": "https://m.media-amazon.com/images/I/81mw592F07L._AC_UL320_ML3_.jpg", "item_price": "299"},
{"item_name": "Bhagavad Gita (A handbook for Students)", "item_url": "https://m.media-amazon.com/images/I/81ugvFGQUoL._AC_UL320_ML3_.jpg", "item_price": "90"},
{"item_name": "Lord krishna's Plastic 46in1 Gayatri Mantra Chanting Box Machine Music Box", "item_url": "https://m.media-amazon.com/images/I/61foqIlQtoL._AC_UL320_ML3_.jpg", "item_price": "399"},
{"item_name": "Valmiki Ramayanam", "item_url": "https://m.media-amazon.com/images/I/71e1hUBbr6L._AC_UL320_ML3_.jpg", "item_price": "250"},
{"item_name": "ISKCON Jagannath Yellow Silver Plated Pendant/Locket for Men and Women", "item_url": "https://m.media-amazon.com/images/I/41Tu01M8apL._AC_UL320_ML3_.jpg", "item_price": "108"},
{"item_name": "ALCiS Women's Asymmetric Vest Top", "item_url": "https://m.media-amazon.com/images/I/81ZYHPtGruL._AC_UL320_ML3_.jpg", "item_price": "216"},
{"item_name": "Lord krishna's Marathi 22 in 1 Digambara Digambara/Shree Swami Samarth/Gayatri Mantra/Maha Mantra (Iskcon Voice) Mini Plug Device Chanting Machine Box for Pooja Room", "item_url": "https://m.media-amazon.com/images/I/61pg6MXTRBL._AC_UL320_ML3_.jpg", "item_price": "219"},
{"item_name": "God's Own Kitchen: The Inspiring Story of Akshaya Patra - A Social Enterprise Run by Monks and CEOs", "item_url": "https://m.media-amazon.com/images/I/51Mp1nshX9L._AC_UL320_ML3_.jpg", "item_price": "207"},
{"item_name": "ISKCON Jagannath Fine Art Krishna with Balaram and Captivates Gopis Poster (Paper, 19.5 x 13.5 inches, Multicolour)", "item_url": "https://m.media-amazon.com/images/I/419nMFbFM5L._AC_UL320_ML3_.jpg", "item_price": "108"},
{"item_name": "Spiritual Warrior I: Uncovering Spiritual Truths in Psychic Phenomena", "item_url": "https://m.media-amazon.com/images/I/510F-ydbJtL._AC_UL320_ML3_.jpg", "item_price": "0"},
{"item_name": "Om Namah Shivaya Digital Audio CD", "item_url": "https://m.media-amazon.com/images/I/91wvF7fhjTL._AC_UL320_ML3_.jpg", "item_price": "108"},
{"item_name": "ISKCON Jagannath Silver Plated Tulsi/Tulasi Kanthi Mala for Men and Women", "item_url": "https://m.media-amazon.com/images/I/81gBm14fNlL._AC_UL320_ML3_.jpg", "item_price": "108"},
{"item_name": "Abloom 108 Beads Iskcon Wood Unisex Tulsi Jaap Mala for Wearing", "item_url": "https://m.media-amazon.com/images/I/613OyG3IsAL._AC_UL320_ML3_.jpg", "item_price": "339"},
{"item_name": "ALCiS Men's Round Neck Cotton T-Shirt", "item_url": "https://m.media-amazon.com/images/I/81Zf0lgPunL._AC_UL320_ML3_.jpg", "item_price": "279"},
{"item_name": "Original Bhagavad Gita (Small Size) \u2014 Dual Color Print", "item_url": "https://m.media-amazon.com/images/I/81FC5v9M0jL._AC_UL320_ML3_.jpg", "item_price": "399"},
{"item_name": "What is the difficulty?: Intimate Monents in the Personal Service of His Divine Grace A.C. Bhaktivedanta Swami Prabhupada", "item_url": "https://m.media-amazon.com/images/I/81pzfbHhntL._AC_UL320_ML3_.jpg", "item_price": "0"},
{"item_name": "ISKCON BBT KRISHNA GIRI GOVERDHAN FINE ART PAPER PRINT POSTER", "item_url": "https://m.media-amazon.com/images/I/614rXT1bOKL._AC_UL320_ML3_.jpg", "item_price": "108"},
{"item_name": "Surrender: The Key to Eternal Life", "item_url": "https://m.media-amazon.com/images/I/71KKdE+ZF-L._AC_UL320_ML3_.jpg", "item_price": "0"},
{"item_name": "Bhagavad Gita As It is English by His Divine Grace A.C.Bhaktivedanta Swami Prabhupada", "item_url": "https://m.media-amazon.com/images/I/51t0IecmHVL._AC_UL320_ML3_.jpg", "item_price": "108"},
{"item_name": "ISKCON Jagannath Fine Art Krishna with Balaram and Captivates Gopis Poster (Paper, 19.5 x 13.5 inches, Multicolour)", "item_url": "https://m.media-amazon.com/images/I/419nMFbFM5L._AC_UL320_ML3_.jpg", "item_price": "108"},
{"item_name": "Gauranga - The golden incarnation of divine love", "item_url": "https://m.media-amazon.com/images/I/51zC3op0HgL._AC_UL320_ML3_.jpg", "item_price": "0"},
];
List cat4 = [
{"item_name": "Easy Journey to Other Planets", "item_url": "https://m.media-amazon.com/images/I/51Y5R51TDYL._AC_UL320_ML3_.jpg", "item_price": "64"},
{"item_name": "Bhagavad Gita As It Is -Pocket Size", "item_url": "https://m.media-amazon.com/images/I/81qwP0egX4L._AC_UL320_ML3_.jpg", "item_price": "108"},
{"item_name": "The Scientific Basis", "item_url": "https://m.media-amazon.com/images/I/811XYk7ZO9L._AC_UL320_ML3_.jpg", "item_price": "110"},
{"item_name": "Bhagavad Gita As It Is (Marathi)", "item_url": "https://m.media-amazon.com/images/I/51QmtclhbbL._AC_UL320_ML3_.jpg", "item_price": "140"},
{"item_name": "Journey Through The Bhagavad Gita - A Modern Commentary With Word-To-Word Sanskrit-English Translation", "item_url": "https://m.media-amazon.com/images/I/61gOL3FKHcL._AC_UL320_ML3_.jpg", "item_price": "3,710"},
{"item_name": "Lord krishna's Marathi 22 in 1 Digambara Digambara/Shree Swami Samarth/Gayatri Mantra/Maha Mantra (Iskcon) Mini Plug Device Chanting Machine Box for Pooja Room", "item_url": "https://m.media-amazon.com/images/I/61pg6MXTRBL._AC_UL320_ML3_.jpg", "item_price": "219"},
{"item_name": "Krishna with cow in Antique golden finish by Handicrafts Paradise", "item_url": "https://m.media-amazon.com/images/I/61ySSL8fcaL._AC_UL320_ML3_.jpg", "item_price": "325"},
{"item_name": "BHAGAVAD GITA ( BENGALI ) (2016 New Edition) -ISKCON \"BEST SELLER\" -Self Help-Greatest...", "item_url": "https://m.media-amazon.com/images/I/51Jjy5NzGiL._AC_UL320_ML3_.jpg", "item_price": "350"},
{"item_name": "The Bhagavad Gita", "item_url": "https://m.media-amazon.com/images/I/71AwuAgQp2L._AC_UL320_ML3_.jpg", "item_price": "199"},
{"item_name": "The Scientific Basis", "item_url": "https://m.media-amazon.com/images/I/811XYk7ZO9L._AC_UL320_ML3_.jpg", "item_price": "110"},
{"item_name": "ISKCON BBT RADHA KRISHNA (RADHA RASBIHARI) FINE ART PAPER PRINT POSTER", "item_url": "https://m.media-amazon.com/images/I/A1zioJ0wIzL._AC_UL320_ML3_.jpg", "item_price": "108"},
{"item_name": "ISKCON Jagannath Metal Lord Shree Krishna Pendant for Men and Women", "item_url": "https://m.media-amazon.com/images/I/518CSiugatL._AC_UL320_ML3_.jpg", "item_price": "108"},
{"item_name": "ISKCON Jagannath Bhagavad-Gita As It is Telugu Hardcover (0.5 x 5.4 x 8.4cm, Multicolour)", "item_url": "https://m.media-amazon.com/images/I/71lKUGZPQtL._AC_UL320_ML3_.jpg", "item_price": "108"},
{"item_name": "Sri Namastaka of Srila Rupa Gosvami Prabhupada", "item_url": "https://m.media-amazon.com/images/I/91mYBtca7ML._AC_UL320_ML3_.jpg", "item_price": "150"},
{"item_name": "A Beginner's Guide to Krishna Consciousness", "item_url": "https://m.media-amazon.com/images/I/91uZrMiutPL._AC_UL320_ML3_.jpg", "item_price": "108"},
{"item_name": "Krishna, The Reservoir of Pleasure", "item_url": "https://m.media-amazon.com/images/I/51-mzzx0H5L._AC_UL320_ML3_.jpg", "item_price": "51"},
{"item_name": "Lord krishna's Marathi 22 in 1 Digambara Digambara/Shree Swami Samarth/Gayatri Mantra/Maha Mantra (Iskcon) Mini Plug Device Chanting Machine Box for Pooja Room", "item_url": "https://m.media-amazon.com/images/I/61pg6MXTRBL._AC_UL320_ML3_.jpg", "item_price": "219"},
{"item_name": "TRUSTFUL Brass Handmade Wall Hanging Surya Chakra Ganesh Idol for Home Decorative", "item_url": "https://m.media-amazon.com/images/I/61vLVeFUuHL._AC_UL320_ML3_.jpg", "item_price": "499"},
{"item_name": "Srila Prabhupada: The Founder-Acarya of ISKCON", "item_url": "https://m.media-amazon.com/images/I/81jnVbvIM2L._AC_UL320_ML3_.jpg", "item_price": "0"},
{"item_name": "The Journey Home: Autobiography of an American Swami", "item_url": "https://m.media-amazon.com/images/I/718A5ClfIdL._AC_UL320_ML3_.jpg", "item_price": "302"},
{"item_name": "ISKCON BBT JAGANNATH BALADEVA SUBHADRA DEITY FINE ART PAPER PRINT POSTER", "item_url": "https://m.media-amazon.com/images/I/A1I3x3wrGvL._AC_UL320_ML3_.jpg", "item_price": "108"},
{"item_name": "ALCiS Men's Round Neck Synthetic T-Shirt", "item_url": "https://m.media-amazon.com/images/I/81R-+2tS8-L._AC_UL320_ML3_.jpg", "item_price": "369"},
{"item_name": "Bhagavad Gita As It Is (Kannada)- World Most Read Edition", "item_url": "https://m.media-amazon.com/images/I/51pXegIKBpL._AC_UL320_ML3_.jpg", "item_price": "294"},
{"item_name": "AEON METAL STICKER 3D Plastic Night Lamp, Multicolour", "item_url": "https://m.media-amazon.com/images/I/81mw592F07L._AC_UL320_ML3_.jpg", "item_price": "299"},
{"item_name": "ISKCON Jagannath Red Silver Plated Lord Jagannath Pendant/Locket for Men and Women", "item_url": "https://m.media-amazon.com/images/I/41QqC+CcTNL._AC_UL320_ML3_.jpg", "item_price": "108"},
{"item_name": "Bhagavad gita : Bio-Science and Psychology (Volume 2)", "item_url": "https://m.media-amazon.com/images/I/61n8nGy+gWL._AC_UL320_ML3_.jpg", "item_price": "499"},
{"item_name": "Om Namah Shivaya Digital Audio CD", "item_url": "https://m.media-amazon.com/images/I/91wvF7fhjTL._AC_UL320_ML3_.jpg", "item_price": "108"},
{"item_name": "Sai Amrut Antique Marble Finish Lord Radha Krishna Statue/Idol 7inch", "item_url": "https://m.media-amazon.com/images/I/81WHZmeDwaL._AC_UL320_ML3_.jpg", "item_price": "899"},
{"item_name": "Spiritual Warrior I: Uncovering Spiritual Truths in Psychic Phenomena", "item_url": "https://m.media-amazon.com/images/I/510F-ydbJtL._AC_UL320_ML3_.jpg", "item_price": "0"},
{"item_name": "Srila Prabhupada Lilamrta: Biography of Srila Prabhupada (Founder Acarya of ISKCON)- 7 Vols. Set", "item_url": "https://m.media-amazon.com/images/I/61IR1YTWorL._AC_UL320_ML3_.jpg", "item_price": "1,800"},
{"item_name": "ISKCON BBT MURALI KRISHNA FINE ART PAPER PRINT POSTER", "item_url": "https://m.media-amazon.com/images/I/61TaicagqnL._AC_UL320_ML3_.jpg", "item_price": "108"},
{"item_name": "100 Contradictions: The Life & Teachings of His Holiness Bhakti Charu Swami", "item_url": "https://m.media-amazon.com/images/I/81CwrmZNefL._AC_UL320_ML3_.jpg", "item_price": "0"},
{"item_name": "ISKCON Jagannath JAAP MALA for Pooja-Astrology-108+1 Beads and Certified Small Size", "item_url": "https://m.media-amazon.com/images/I/41XLJJ9XKsL._AC_UL320_ML3_.jpg", "item_price": "108"},
{"item_name": "ISKCON Kitchen Tools of Sev Sancha/idiyappam/murukku/sev Maker Machine/chakli/Kitchen Press Stainless Steel Different Type of jalis", "item_url": "https://m.media-amazon.com/images/I/415BSY0hB-L._AC_UL320_ML3_.jpg", "item_price": "346"},
{"item_name": "ALCiS Men's Round Neck Synthetic T-Shirt", "item_url": "https://m.media-amazon.com/images/I/81IdDHpUMGL._AC_UL320_ML3_.jpg", "item_price": "279"},
{"item_name": "ISKCON Jagannath, Balaram and Subhadra (Stone Statue) No 4B Stand 2.75 x 4.5 x 1 inches", "item_url": "https://m.media-amazon.com/images/I/81mUarwr7ML._AC_UL320_ML3_.jpg", "item_price": "108"},
{"item_name": "Krishna with cow in Antique golden finish by Handicrafts Paradise", "item_url": "https://m.media-amazon.com/images/I/61ySSL8fcaL._AC_UL320_ML3_.jpg", "item_price": "325"},
{"item_name": "TRUSTFUL Brass Handmade Wall Hanging Surya Chakra Ganesh Idol for Home Decorative", "item_url": "https://m.media-amazon.com/images/I/61vLVeFUuHL._AC_UL320_ML3_.jpg", "item_price": "499"},
{"item_name": "Gita According to Gandhi (General Press)", "item_url": "https://m.media-amazon.com/images/I/71VN-LvgOOL._AC_UL320_ML3_.jpg", "item_price": "156"},
{"item_name": "Krishna with cow in Antique golden finish by Handicrafts Paradise", "item_url": "https://m.media-amazon.com/images/I/61ySSL8fcaL._AC_UL320_ML3_.jpg", "item_price": "325"},
{"item_name": "TRUSTFUL Brass Handmade Wall Hanging Surya Chakra Ganesh Idol for Home Decorative", "item_url": "https://m.media-amazon.com/images/I/61vLVeFUuHL._AC_UL320_ML3_.jpg", "item_price": "499"},
{"item_name": "Radha Krishna Wall Hanging |Radha Krishna Jhula Wall Hanging for Home Decor", "item_url": "https://m.media-amazon.com/images/I/71TmSRkmAEL._AC_UL320_ML3_.jpg", "item_price": "799"},
{"item_name": "Fabzone Brown Antique Look Lord Ganesha God OM Ganesh Ganpati Idol Statue Wall Hanging Showpiece Figurine", "item_url": "https://m.media-amazon.com/images/I/71d8VOc22PL._AC_UL320_ML3_.jpg", "item_price": "599"},
{"item_name": "Crafthut Handmade Brass Material Statue of Lord Radha Krishna Seating on Jhoola/Swing", "item_url": "https://m.media-amazon.com/images/I/71rHTeqk2AL._AC_UL320_ML3_.jpg", "item_price": "1,499"},
];
List cat5= [
{"item_name": "The Nectar of Instruction", "item_url": "https://m.media-amazon.com/images/I/81GM0OodKHL._AC_UL320_ML3_.jpg", "item_price": "70"},
{"item_name": "Bhagavad Gita As It Is Macmillan-Original Edition", "item_url": "https://m.media-amazon.com/images/I/81raGIB2zLL._AC_UL320_ML3_.jpg", "item_price": "255"},
{"item_name": "ISKCON Rudraksha 5 Mukhi RUDRAKSHA JAAP MALA / BEADS FOR POOJA (ASTROLOGY) (108+1 Beads) 100% Original and Certified", "item_url": "https://m.media-amazon.com/images/I/41fLbHcYqJL._AC_UL320_ML3_.jpg", "item_price": "108"},
{"item_name": "ALCiS Women's Asymmetric Vest Top", "item_url": "https://m.media-amazon.com/images/I/81ZYHPtGruL._AC_UL320_ML3_.jpg", "item_price": "216"},
{"item_name": "Bhagavad Gita As It is Hindi by His Divine Grace A.C.Bhaktivedanta Swami Srila Prabhupada", "item_url": "https://m.media-amazon.com/images/I/51esXLpRisL._AC_UL320_ML3_.jpg", "item_price": "108"},
{"item_name": "ISKCON Jagannath JAAP MALA for Pooja-Astrology-108+1 Beads and Certified Small Size", "item_url": "https://m.media-amazon.com/images/I/41XLJJ9XKsL._AC_UL320_ML3_.jpg", "item_price": "108"},
{"item_name": "Gita According to Gandhi (General Press)", "item_url": "https://m.media-amazon.com/images/I/71VN-LvgOOL._AC_UL320_ML3_.jpg", "item_price": "156"},
{"item_name": "Sri Namastaka of Srila Rupa Gosvami Prabhupada", "item_url": "https://m.media-amazon.com/images/I/91mYBtca7ML._AC_UL320_ML3_.jpg", "item_price": "150"},
{"item_name": "What is the difficulty?: Intimate Monents in the Personal Service of His Divine Grace A.C. Bhaktivedanta Swami Prabhupada", "item_url": "https://m.media-amazon.com/images/I/81pzfbHhntL._AC_UL320_ML3_.jpg", "item_price": "0"},
{"item_name": "ISKCON Jagannath Dashavatara Fine Art Paper Print Poster", "item_url": "https://m.media-amazon.com/images/I/612AqGdJ+2L._AC_UL320_ML3_.jpg", "item_price": "108"},
{"item_name": "The Four Vedas Mantras Digital Audio CD", "item_url": "https://m.media-amazon.com/images/I/910fVVoRWLL._AC_UL320_ML3_.jpg", "item_price": "108"},
{"item_name": "ISKCON Jagannath Yellow Silver Plated Pendant/Locket for Men and Women", "item_url": "https://m.media-amazon.com/images/I/41Tu01M8apL._AC_UL320_ML3_.jpg", "item_price": "108"},
{"item_name": "Lord krishna's 46 in 1 Gayatri Mantra Hare Krishna (Iskcon Voice) Mini Plug Chanting Machine Box for Pooja Room", "item_url": "https://m.media-amazon.com/images/I/61CBIqOgLwL._AC_UL320_ML3_.jpg", "item_price": "299"},
{"item_name": "Life's Amazing Secrets (Hindi): Jeevan Ke Adbhut Rahasya", "item_url": "https://m.media-amazon.com/images/I/71c96eeGwjL._AC_UL320_ML3_.jpg", "item_price": "97"},
{"item_name": "The Bhagavad Gita", "item_url": "https://m.media-amazon.com/images/I/91atqshFQnL._AC_UL320_ML3_.jpg", "item_price": "0"},
{"item_name": "ISKCON Jagannath Tulsi Bead Triple Layer Kanthi Mala for Neck", "item_url": "https://m.media-amazon.com/images/I/91qX4o7A5lL._AC_UL320_ML3_.jpg", "item_price": "198"},
{"item_name": "bhagavad gita (oriya)", "item_url": "https://m.media-amazon.com/images/I/61yNGq7tWoL._AC_UL320_ML3_.jpg", "item_price": "295"},
{"item_name": "Krsna Pastimes Colouring Book", "item_url": "https://m.media-amazon.com/images/I/51jXgv4NSIL._AC_UL320_ML3_.jpg", "item_price": "165"},
{"item_name": "ISKCON Jagannath Metal Lord Shree Krishna Pendant for Men and Women", "item_url": "https://m.media-amazon.com/images/I/518CSiugatL._AC_UL320_ML3_.jpg", "item_price": "108"},
{"item_name": "ISKCON Jagannath Bbt Murali Krishna Fine Art Print Poster (Paper, Multicolour)", "item_url": "https://m.media-amazon.com/images/I/61Y5-PgkdGL._AC_UL320_ML3_.jpg", "item_price": "108"},
{"item_name": "Arcana, Volume 4: The ISKCON Deity Worship Journal", "item_url": "https://m.media-amazon.com/images/I/71f2Zz8PdwL._AC_UL320_ML3_.jpg", "item_price": "0"},
{"item_name": "Valmiki Ramayanam", "item_url": "https://m.media-amazon.com/images/I/71e1hUBbr6L._AC_UL320_ML3_.jpg", "item_price": "250"},
{"item_name": "The Scientific Basis", "item_url": "https://m.media-amazon.com/images/I/811XYk7ZO9L._AC_UL320_ML3_.jpg", "item_price": "110"},
{"item_name": "ISKCON Jagannath Krishna Dances over Kaliya Snake Hood Fine Art Paper Print Poster (Multicolour, 19.5 x 13.5 inches)", "item_url": "https://m.media-amazon.com/images/I/71VRGAa0wGL._AC_UL320_ML3_.jpg", "item_price": "108"},
{"item_name": "ALCiS Men's Round Neck Synthetic T-Shirt", "item_url": "https://m.media-amazon.com/images/I/81IdDHpUMGL._AC_UL320_ML3_.jpg", "item_price": "279"},
{"item_name": "ISKCON Jagannath Certified Copper or Tamba Ring Adjustable and Flexible Size for Men and Women", "item_url": "https://m.media-amazon.com/images/I/61C4hI37+rL._AC_UL320_ML3_.jpg", "item_price": "108"},
{"item_name": "Arcana, Volume 3: The ISKCON Deity Worship Journal", "item_url": "https://m.media-amazon.com/images/I/81rZ4Fbv+bL._AC_UL320_ML3_.jpg", "item_price": "0"},
{"item_name": "The Bhagavad Gita (Hardcover Library Edition)", "item_url": "https://m.media-amazon.com/images/I/71T4Lx7KcZL._AC_UL320_ML3_.jpg", "item_price": "184"},
{"item_name": "A Beginner's Guide to Krishna Consciousness", "item_url": "https://m.media-amazon.com/images/I/91uZrMiutPL._AC_UL320_ML3_.jpg", "item_price": "108"},
{"item_name": "Bhagavad gita : Bio-Science and Psychology (Volume 2)", "item_url": "https://m.media-amazon.com/images/I/61n8nGy+gWL._AC_UL320_ML3_.jpg", "item_price": "499"},
{"item_name": "Bhakti: The Art of Eternal Love", "item_url": "https://m.media-amazon.com/images/I/61M7e+GtdhL._AC_UL320_ML3_.jpg", "item_price": "110"},
{"item_name": "Krsna Karnamrta", "item_url": "https://m.media-amazon.com/images/I/51wb9kjS3eL._AC_UL320_ML3_.jpg", "item_price": "270"},
{"item_name": "Krishna Playing Flute Fun Spring -VRINDAVANBAZAAR.COM", "item_url": "https://m.media-amazon.com/images/I/61iriQYOQvL._AC_UL320_ML3_.jpg", "item_price": "200"},
{"item_name": "Om Namah Shivaya Digital Audio CD", "item_url": "https://m.media-amazon.com/images/I/91wvF7fhjTL._AC_UL320_ML3_.jpg", "item_price": "108"},
{"item_name": "Sai Amrut Antique Marble Finish Lord Radha Krishna Statue/Idol 7inch", "item_url": "https://m.media-amazon.com/images/I/81WHZmeDwaL._AC_UL320_ML3_.jpg", "item_price": "899"},
{"item_name": "La Derni\u00e8re Directive: Etablit que Srila Prabhupada est le ma\u00eetre spirituel donnant l\u2019initiation dans ISKCON (French Edition)", "item_url": "https://m.media-amazon.com/images/I/81q4zW7gMUL._AC_UL320_ML3_.jpg", "item_price": "0"},
{"item_name": "ISKCON Jagannath Red Silver Plated Lord Jagannath Pendant/Locket for Men and Women", "item_url": "https://m.media-amazon.com/images/I/41QqC+CcTNL._AC_UL320_ML3_.jpg", "item_price": "108"},
{"item_name": "The Wisdom of the Gita: A Manual for Life", "item_url": "https://m.media-amazon.com/images/I/71i-T9nuI7L._AC_UL320_ML3_.jpg", "item_price": "103"},
{"item_name": "ALCiS Men's Round Neck Synthetic T-Shirt", "item_url": "https://m.media-amazon.com/images/I/81F8ywJjy5L._AC_UL320_ML3_.jpg", "item_price": "387"},
{"item_name": "La Order Final: Un ensayo que trata sobre las instrucciones de Srila Prabhupada acerca de las iniciaciones en ISKCON (Spanish Edition)", "item_url": "https://m.media-amazon.com/images/I/91Uulrgpv3L._AC_UL320_ML3_.jpg", "item_price": "49"},
{"item_name": "Lord krishna's Marathi 22 in 1 Digambara Digambara/Shree Swami Samarth/Gayatri Mantra/Maha Mantra (Iskcon Voice) Mini Plug Device Chanting Machine Box for Pooja Room", "item_url": "https://m.media-amazon.com/images/I/61pg6MXTRBL._AC_UL320_ML3_.jpg", "item_price": "219"},
{"item_name": "Bhagavad-Gita As it is (Tamil) World Most Read Edition", "item_url": "https://m.media-amazon.com/images/I/A1O706YyDmL._AC_UL320_ML3_.jpg", "item_price": "178"},
{"item_name": "In Search of the Ultimate Goal of Life", "item_url": "https://m.media-amazon.com/images/I/91q6VApbMuL._AC_UL320_ML3_.jpg", "item_price": "250"},
{"item_name": "A Comprehensive Guide to Bhagavad-Gita with Literal Translation", "item_url": "https://m.media-amazon.com/images/I/71ZUJA9lepL._AC_UL320_ML3_.jpg", "item_price": "490"},
{"item_name": "Srila Prabhupada Lilamrta: Biography of Srila Prabhupada (Founder Acarya of ISKCON)- 7 Vols. Set", "item_url": "https://m.media-amazon.com/images/I/61IR1YTWorL._AC_UL320_ML3_.jpg", "item_price": "1,800"},
{"item_name": "ISKCON Jagannath Fine Art Krishna with Balaram and Captivates Gopis Poster (Paper, 19.5 x 13.5 inches, Multicolour)", "item_url": "https://m.media-amazon.com/images/I/419nMFbFM5L._AC_UL320_ML3_.jpg", "item_price": "108"},
{"item_name": "ISKCON Jagannath Divine Kala Black Moti for Men and Women", "item_url": "https://m.media-amazon.com/images/I/71KZqj5RSAL._AC_UL320_ML3_.jpg", "item_price": "108"},
{"item_name": "The \u015aik\u1e63\u0101-guru: Implementing Tradition Within ISKCON", "item_url": "https://m.media-amazon.com/images/I/91M-SWUZEAL._AC_UL320_ML3_.jpg", "item_price": "268"},
{"item_name": "Krishna with cow in Antique golden finish by Handicrafts Paradise", "item_url": "https://m.media-amazon.com/images/I/61ySSL8fcaL._AC_UL320_ML3_.jpg", "item_price": "325"},
{"item_name": "TRUSTFUL Brass Handmade Wall Hanging Surya Chakra Ganesh Idol for Home Decorative", "item_url": "https://m.media-amazon.com/images/I/61vLVeFUuHL._AC_UL320_ML3_.jpg", "item_price": "499"},
];
| 0
|
mirrored_repositories/InstaMojo-Payment-App/lib
|
mirrored_repositories/InstaMojo-Payment-App/lib/custom_widgets/button.dart
|
import 'package:flutter/material.dart';
import 'package:folk_payments/utilities/constants.dart';
class Button extends StatelessWidget {
Button({@required this.text, @required this.onPressed});
final text;
final onPressed;
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.all(26.0),
child: GestureDetector(
child: Container(
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Text(
text,
textAlign: TextAlign.center,
style: kInputBoxStyle.copyWith(color: Colors.white),
),
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20.0),
shape: BoxShape.rectangle,
color: kRedColor,
),
width: double.infinity,
),
onTap: onPressed,
),
);
}
}
| 0
|
mirrored_repositories/InstaMojo-Payment-App/lib
|
mirrored_repositories/InstaMojo-Payment-App/lib/custom_widgets/category.dart
|
import 'package:flutter/material.dart';
import 'package:folk_payments/utilities/constants.dart';
class Category extends StatelessWidget {
Category({@required this.catName, @required this.onTap});
final catName;
final onTap;
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.all(18.0),
child: InkWell(
child: Text(
catName,
style: kInputBoxInputTextStyle,
),
onTap: onTap,
),
);
}
}
| 0
|
mirrored_repositories/InstaMojo-Payment-App/lib
|
mirrored_repositories/InstaMojo-Payment-App/lib/custom_widgets/input_box.dart
|
import 'package:flutter/material.dart';
import 'package:folk_payments/utilities/constants.dart';
class InputBox extends StatelessWidget {
InputBox({@required this.text, this.hintText, this.textCapitalization});
final text;
final hintText;
final textCapitalization;
var input;
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.all(4.0),
child: TextField(
textCapitalization: textCapitalization ?? TextCapitalization.none,
decoration: InputDecoration(
labelText: text,
labelStyle: kInputBoxStyle,
hintText: hintText,
hintStyle: kInputBoxStyle.copyWith(fontSize: 16.0),
contentPadding: EdgeInsets.all(16.0),
filled: true,
fillColor: kInputBoxColor,
alignLabelWithHint: true,
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(20.0),
),
),
style: kInputBoxInputTextStyle,
maxLines: 3,
onChanged: (val) {
input = val;
},
),
);
}
}
| 0
|
mirrored_repositories/InstaMojo-Payment-App/lib
|
mirrored_repositories/InstaMojo-Payment-App/lib/screens/view_product.dart
|
import 'package:flutter/material.dart';
import 'package:folk_payments/screens/folk_details.dart';
import 'package:folk_payments/screens/products.dart';
import 'package:folk_payments/utilities/constants.dart';
import 'package:folk_payments/screens/instamojo.dart';
class View extends StatefulWidget {
View({@required this.index});
final index;
@override
_ViewState createState() => _ViewState();
}
class _ViewState extends State<View> {
@override
Widget build(BuildContext context) {
return SafeArea(
child: Scaffold(
appBar: AppBar(
title: Text(
'VIEW PRODUCT',
),
centerTitle: true,
),
body: Column(
children: <Widget>[
Expanded(
flex: 5,
child: Padding(
padding: const EdgeInsets.all(18.0),
child: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(18.0),
),
width: double.infinity,
height: double.infinity,
child: Image.network(
categoryItem[widget.index]['item_url'],
),
),
),
),
Padding(
padding: const EdgeInsets.all(16.0),
child: Text(
categoryItem[widget.index]['item_name'],
style: kInputBoxInputTextStyle.copyWith(
fontWeight: FontWeight.w300,
letterSpacing: 2.0,
fontSize: 22.0,
),
maxLines: 4,
textAlign: TextAlign.center,
),
),
Expanded(
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6.0),
),
child: Text(
'₹${categoryItem[widget.index]['item_price'] == '0' ? '108' : categoryItem[widget.index]['item_price']}',
style: kInputBoxInputTextStyle.copyWith(
fontWeight: FontWeight.w700,
letterSpacing: 2.0,
fontSize: 22.0,
),
textAlign: TextAlign.center,
),
),
),
),
GestureDetector(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => Details(
index: widget.index,
),
),
);
},
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Container(
width: double.infinity,
decoration: BoxDecoration(
color: Colors.orange,
borderRadius: BorderRadius.circular(8.0),
),
child: Padding(
padding: const EdgeInsets.all(18.0),
child: Text(
'BUY ITEM',
style: kInputBoxInputTextStyle.copyWith(
fontWeight: FontWeight.w400,
letterSpacing: 5.0,
fontSize: 20.0,
),
textAlign: TextAlign.center,
),
),
),
),
),
],
),
),
);
}
}
| 0
|
mirrored_repositories/InstaMojo-Payment-App/lib
|
mirrored_repositories/InstaMojo-Payment-App/lib/screens/instamojo.dart
|
import 'package:flutter/material.dart';
import 'dart:convert';
import 'package:folk_payments/screens/products.dart';
import 'package:folk_payments/screens/login_screen.dart';
import 'package:sms/sms.dart';
import 'package:folk_payments/screens/folk_details.dart';
import 'package:http/http.dart' as http;
import 'package:flutter_webview_plugin/flutter_webview_plugin.dart';
class InstaMojo extends StatefulWidget {
static const routeName = 'InstaMojo';
InstaMojo({@required this.index, @required this.name, @required this.phone});
final index;
final name;
final phone;
@override
_InstaMojoState createState() => _InstaMojoState();
}
class _InstaMojoState extends State<InstaMojo> {
final flutterWebviewPlugin = new FlutterWebviewPlugin();
static const kAndroidUserAgent =
"Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Mobile Safari/537.36";
Future createRequest() async {
print('U N N N N N ' + un.input ?? 'null');
Map<String, String> body = {
"amount": categoryItem[widget.index]['item_price'], //amount to be paid
"purpose": "Advertising",
"buyer_name": widget.name,
"email": un.input,
"phone": widget.phone,
"allow_repeated_payments": "true",
"send_email": "false",
"send_sms": "true",
"redirect_url": "https://github.com",
"webhook": "https://github.com",
};
//First we have to create a Payment_Request.
//then we'll take the response of our request.
var resp = await http.post(
Uri.encodeFull("https://test.instamojo.com/api/1.1/payment-requests/"),
headers: {
"Accept": "application/json",
"Content-Type": "application/x-www-form-urlencoded",
"X-Api-Key": "test_d55f74e68ff03b26c33dc1386bc",
"X-Auth-Token": "test_d06b0e24d9e95fb372551c568ee",
},
body: body);
if (json.decode(resp.body)['success'] == true) {
//If request is successful take the longurl.
String selectedUrl =
json.decode(resp.body)["payment_request"]['longurl'].toString() +
"?embed=form";
flutterWebviewPlugin.close();
//Let's open the url in webview.
flutterWebviewPlugin.launch(selectedUrl,
rect: new Rect.fromLTRB(
5.0,
MediaQuery.of(context).size.height / 7,
MediaQuery.of(context).size.width - 5.0,
7 * MediaQuery.of(context).size.height / 7),
userAgent: kAndroidUserAgent);
} else {
print(resp.body);
}
}
Future<void> sendOtp() async {
print('in here : '+'+91'+myph.phno);
SmsSender sender = new SmsSender();
String address = '+91'+myph.phno;
String message = categoryItem[widget.index]['item_name']+
':' + categoryItem[widget.index]['item_price'];
sender.sendSms(new SmsMessage(address, message));
}
@override
void initState() {
super.initState();
print('sdsadasds');
createRequest(); //creating the HTTP request
// Add a listener on url changed
flutterWebviewPlugin.onUrlChanged.listen((String url) {
if (mounted) {
if (url.contains('http://www.example.com/redirect')) {
Uri uri = Uri.parse(url);
//Take the payment_id parameter of the url.
String paymentRequestId = uri.queryParameters['payment_id'];
//calling this method to check payment status
_checkPaymentStatus(paymentRequestId);
}
}
});
}
_checkPaymentStatus(String id) async {
var response = await http.get(
Uri.encodeFull("https://t7st.instamojo.com/api/1.1/payments/$id/"),
headers: {
"Accept": "application/json",
"Content-Type": "application/x-www-form-urlencoded",
"X-Api-Key": "test_d55f74e68ff03b26c33dc1386bc",
"X-Auth-Token": "test_d06b0e24d9e95fb372551c568ee",
},
);
var realResponse = json.decode(response.body);
print(realResponse);
if (realResponse['success'] == true) {
if (realResponse["payment"]['status'] == 'Credit') {
//payment is successful.
print('sucesss');
} else {
//payment failed or pending.
}
} else {
print(realResponse);
}
}
@override
Widget build(BuildContext context) {
return SafeArea(
child: Scaffold(
appBar: AppBar(
title: Text('FOLK PAYMENTS'),
actions: <Widget>[
IconButton(
icon: Icon(Icons.backspace),
onPressed: () {
flutterWebviewPlugin.close();
sendOtp();
Navigator.of(context).pop();
showDialog(
context: context,
builder: (BuildContext context) {
return AlertDialog(
content: Text('Confirmation message sent'),
actions: <Widget>[
FlatButton(
child: Text('Ok'),
onPressed: () {
Navigator.of(context).pop();
},
),
],
);
},
);
},
)
],
),
),
);
}
}
| 0
|
mirrored_repositories/InstaMojo-Payment-App/lib
|
mirrored_repositories/InstaMojo-Payment-App/lib/screens/folk_details.dart
|
import 'package:flutter/material.dart';
import 'package:folk_payments/screens/instamojo.dart';
import 'package:folk_payments/screens/products.dart';
import 'package:folk_payments/custom_widgets/input_box.dart';
import 'package:folk_payments/custom_widgets/button.dart';
import 'package:cloud_firestore/cloud_firestore.dart';
class ph {
String phno;
}
ph myph = new ph();
class Details extends StatefulWidget {
Details({@required this.index});
final index;
@override
_DetailsState createState() => _DetailsState();
}
class _DetailsState extends State<Details> {
var name = InputBox(text: 'Name');
var phone = InputBox(text: 'Phone');
var discount = InputBox(text: 'Discount Code');
@override
Widget build(BuildContext context) {
return SafeArea(
child: Scaffold(
appBar: AppBar(
title: Text(
'USER INFO',
),
centerTitle: true,
),
body: ListView(
children: <Widget>[
name,
phone,
discount,
Button(
text: 'SUBMIT AND PAY',
onPressed: () async {
if (discount.input == null|| discount.input =='' ) {
print('should work , ${widget.index}, ${name.input} ${phone.input}');
myph.phno = phone.input;
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => InstaMojo(
index: widget.index,
name: name.input,
phone: phone.input,
),
),
);
} else {
print('inside');
Firestore.instance
.collection('coupons')
.document(discount.input)
.get()
.then((DocumentSnapshot ds) {
if (ds.exists) {
print(ds.data['discount']);
categoryItem[widget.index]['item_price'] =
(int.parse(categoryItem[widget.index]['item_price']) -
ds.data['discount'])
.toString();
print(categoryItem[widget.index]['item_price']);
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => InstaMojo(
index: widget.index,
name: name.input,
phone: phone.input,
),
),
);
} else {
print('in');
showDialog(
context: context,
builder: (BuildContext context) {
return AlertDialog(
content: Text('Invalid Coupon Code'),
actions: <Widget>[
FlatButton(
child: Text('DISMISS'),
onPressed: () {
Navigator.of(context).pop();
},
),
],
);
},
);
// print('doesnt exist');
// print(show);
// show = true;
// if (show) {
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) => InstaMojo(
// index: widget.index,
// name: name.input,
// email: email.input,
// phone: phone.input,
// ),
// ),
// ); // use ds as a snapshot
// }
}
});
}
},
),
],
),
),
);
}
}
| 0
|
mirrored_repositories/InstaMojo-Payment-App/lib
|
mirrored_repositories/InstaMojo-Payment-App/lib/screens/categories.dart
|
import 'package:flutter/material.dart';
import 'package:folk_payments/screens/products.dart';
import 'package:folk_payments/custom_widgets/category.dart';
import 'package:folk_payments/utilities/constants.dart';
import 'package:folk_payments/custom_widgets/input_box.dart';
class Categories extends StatefulWidget {
static const routeName = 'Categories';
@override
_CategoriesState createState() => _CategoriesState();
}
class _CategoriesState extends State<Categories> {
final GlobalKey<ScaffoldState> _scaffoldKey = new GlobalKey<ScaffoldState>();
@override
Widget build(BuildContext context) {
return SafeArea(
child: Scaffold(
key: _scaffoldKey,
appBar: AppBar(
title: Text('FOLK PAYMENT'),
automaticallyImplyLeading: false,
centerTitle: true,
leading: IconButton(
icon: Icon(Icons.menu),
onPressed: () {
_scaffoldKey.currentState.openDrawer();
},
),
),
drawer: Drawer(
child: Column(
children: <Widget>[
DrawerHeader(
child: Column(
children: <Widget>[
InkWell(
child: IconButton(
icon: Icon(
Icons.arrow_back,
color: Colors.white,
),
onPressed: () {
Navigator.of(context).pop();
},
),
),
Center(
child: Text(
'Categories',
style: kInputBoxInputTextStyle.copyWith(
fontSize: 50.0,
color: Colors.white,
),
),
),
],
),
decoration: BoxDecoration(
color: Colors.black,
),
),
SizedBox(
height: 30.0,
),
Category(
catName: 'Category1',
onTap: () => Navigator.push(context,
MaterialPageRoute(builder: (context) => Products(cat: 1))),
),
Divider(),
Category(
catName: 'Category2',
onTap: () => Navigator.push(context,
MaterialPageRoute(builder: (context) => Products(cat: 2))),
),
Divider(),
Category(
catName: 'Category3',
onTap: () => Navigator.push(context,
MaterialPageRoute(builder: (context) => Products(cat: 3))),
),
Divider(),
Category(
catName: 'Category4',
onTap: () => Navigator.push(context,
MaterialPageRoute(builder: (context) => Products(cat: 4))),
),
Divider(),
Category(
catName: 'Category5',
onTap: () => Navigator.push(context,
MaterialPageRoute(builder: (context) => Products(cat: 5))),
),
],
),
),
body: Center(
child: Text(
'SELECT CATEGORY',
style: kInputBoxInputTextStyle,
),
),
),
);
}
}
| 0
|
mirrored_repositories/InstaMojo-Payment-App/lib
|
mirrored_repositories/InstaMojo-Payment-App/lib/screens/login_screen.dart
|
import 'package:flutter/material.dart';
import 'package:folk_payments/custom_widgets/input_box.dart';
import 'package:folk_payments/screens/categories.dart';
import 'package:folk_payments/custom_widgets/button.dart';
import 'package:firebase_auth/firebase_auth.dart';
class LoginScreen extends StatefulWidget {
LoginScreen({Key key}) : super(key: key);
static const routeName = 'LoginScreen';
@override
_LoginScreenState createState() => _LoginScreenState();
}
var un = InputBox(text: 'Folk ID');
class _LoginScreenState extends State<LoginScreen> {
var pw = InputBox(text: 'Folk Password');
final auth = FirebaseAuth.instance;
AuthResult user;
@override
Widget build(BuildContext context) {
return SafeArea(
child: Scaffold(
appBar: AppBar(
title: Text('Login'),
automaticallyImplyLeading: false,
centerTitle: true,
),
body: Padding(
padding: const EdgeInsets.all(18.0),
child: ListView(
children: [
Column(
children: <Widget>[
un,
pw,
Button(
text: 'LOGIN',
onPressed: () async {
try {
user = await auth.signInWithEmailAndPassword(
email: un.input, password: pw.input);
if (user != null) {
Navigator.of(context).pop();
Navigator.pushNamed(context, Categories.routeName);
}
} catch (e) {
print(e);
}
},
),
],
),
],
),
),
),
);
}
}
| 0
|
mirrored_repositories/InstaMojo-Payment-App/lib
|
mirrored_repositories/InstaMojo-Payment-App/lib/screens/products.dart
|
import 'package:flutter/material.dart';
import 'package:folk_payments/screens/view_product.dart';
import 'package:folk_payments/utilities/constants.dart';
import 'package:folk_payments/utilities/items.dart';
import 'package:folk_payments/custom_widgets/category.dart';
List categoryItem;
class Products extends StatelessWidget {
final GlobalKey<ScaffoldState> _scaffoldKey = new GlobalKey<ScaffoldState>();
static const routeName = 'Products';
final cat;
Products({@required this.cat});
@override
Widget build(BuildContext context) {
if (cat == 1) categoryItem = cat1;
if (cat == 2) categoryItem = cat2;
if (cat == 3) categoryItem = cat3;
if (cat == 4) categoryItem = cat4;
if (cat == 5) categoryItem = cat5;
return Scaffold(
appBar: AppBar(
title: Text('FOLK PAYMENT'),
automaticallyImplyLeading: false,
centerTitle: true,
leading: IconButton(
icon: Icon(Icons.menu),
onPressed: () {
_scaffoldKey.currentState.openDrawer();
},
),
),
drawer: Drawer(
child: Column(
children: <Widget>[
DrawerHeader(
child: Column(
children: <Widget>[
InkWell(
child: IconButton(
icon: Icon(
Icons.arrow_back,
color: Colors.white,
),
onPressed: () {
Navigator.of(context).pop();
},
),
),
Center(
child: Text(
'Categories',
style: kInputBoxInputTextStyle.copyWith(
fontSize: 50.0,
color: Colors.white,
),
),
),
],
),
decoration: BoxDecoration(
color: Colors.black,
),
),
SizedBox(
height: 30.0,
),
Category(
catName: 'Category1',
onTap: () => Navigator.push(context,
MaterialPageRoute(builder: (context) => Products(cat: 1))),
),
Divider(thickness: 3.0,),
Category(
catName: 'Category2',
onTap: () => Navigator.push(context,
MaterialPageRoute(builder: (context) => Products(cat: 2))),
),
Divider(thickness: 3.0,),
Category(
catName: 'Category3',
onTap: () => Navigator.push(context,
MaterialPageRoute(builder: (context) => Products(cat: 3))),
),
Divider(thickness: 3.0,),
Category(
catName: 'Category4',
onTap: () => Navigator.push(context,
MaterialPageRoute(builder: (context) => Products(cat: 4))),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Divider(thickness: 3.0,),
),
Category(
catName: 'Category5',
onTap: () => Navigator.push(context,
MaterialPageRoute(builder: (context) => Products(cat: 5))),
),
],
),
),
body: Scrollbar(
child: Padding(
padding: const EdgeInsets.all(4.0),
child: GridView.count(
crossAxisCount: 2,
crossAxisSpacing: 4.0,
mainAxisSpacing: 4.0,
children: List.generate(
categoryItem.length,
(i) {
return GestureDetector(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => View(index: i)));
},
child: GridTile(
child: Column(
children: <Widget>[
Expanded(
flex: 4,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
width: double.infinity,
height: double.infinity,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8.0),
),
child: Image.network(
categoryItem[i]['item_url'],
),
),
),
),
Expanded(
flex: 1,
child: Text(
categoryItem[i]['item_name'],
style: kInputBoxInputTextStyle.copyWith(
fontSize: 12.0),
textAlign: TextAlign.center,
),
),
Expanded(
flex: 1,
child: Text(
'₹${categoryItem[i]['item_price'] == '0' ? '108' : categoryItem[i]['item_price']}',
style: kInputBoxInputTextStyle,
textAlign: TextAlign.center,
),
),
],
),
),
);
},
),
),
),
),
);
}
}
| 0
|
mirrored_repositories/WhatsAppUIClone
|
mirrored_repositories/WhatsAppUIClone/lib/main.dart
|
import 'package:flutter/material.dart';
import 'package:whatsappclone/WhatsAppHome.dart';
import 'package:camera/camera.dart';
import 'dart:async';
List<CameraDescription> cameras;
Future<Null> main() async {
cameras = await availableCameras();
runApp(new MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
debugShowCheckedModeBanner: false,
title: "WhatsApp",
theme: new ThemeData(
primaryColor: new Color(0xff075E54),
accentColor: new Color(0xff25D366)),
home: new WhatsAppHome(cameras),
);
}
}
| 0
|
mirrored_repositories/WhatsAppUIClone
|
mirrored_repositories/WhatsAppUIClone/lib/WhatsAppHome.dart
|
import 'package:flutter/material.dart';
import 'package:whatsappclone/view/camera_full.dart';
import 'package:whatsappclone/view/Contacts.dart';
import 'package:whatsappclone/view/new_call.dart';
import 'package:whatsappclone/pages/calls.dart';
import 'package:whatsappclone/pages/camera.dart';
import 'package:whatsappclone/pages/chats.dart';
import 'package:whatsappclone/pages/status.dart';
class WhatsAppHome extends StatefulWidget {
var cameras;
WhatsAppHome(this.cameras);
@override
State<StatefulWidget> createState() => new _WhatsAppHomeState();
}
class _WhatsAppHomeState extends State<WhatsAppHome>
with SingleTickerProviderStateMixin {
TabController _tabController;
_fab selectedfab;
@override
void initState() {
super.initState();
_tabController = new TabController(length: 4, vsync: this, initialIndex: 1);
_tabController.addListener(_handleTab);
selectedfab = fablist[1];
}
@override
void dispose() {
_tabController.dispose();
super.dispose();
}
void _handleTab() {
setState(() {
selectedfab = fablist[_tabController.index];
});
}
@override
Widget build(BuildContext context) {
final key = new GlobalKey<ScaffoldState>();
return new Scaffold(
appBar: new AppBar(
title: new Text("WhatsApp"),
elevation: 0.7,
bottom: new TabBar(
controller: _tabController,
indicatorColor: Colors.white,
tabs: <Widget>[
new Tab(
child: new Icon(Icons.camera_alt),
),
new Tab(text: "CHATS"),
new Tab(text: "STATUS"),
new Tab(text: "CALLS"),
],
),
actions: <Widget>[
new Icon(Icons.search),
new Padding(padding: const EdgeInsets.symmetric(horizontal: 5.0)),
new PopupMenuButton(
itemBuilder: (BuildContext context) => <PopupMenuItem<String>>[
const PopupMenuItem(
value: "Newgroup", child: Text("New group")),
PopupMenuItem(
value: "New broadcast",
child: Text("New broadcast"),
),
PopupMenuItem(
value: "WhatsApp web",
child: Text("WhatsApp web"),
),
PopupMenuItem(
value: "Starred messages",
child: Text("Starred message"),
),
PopupMenuItem(
value: "Setting",
child: Text("Setting"),
)
])
],
),
body: new TabBarView(
controller: _tabController,
children: <Widget>[
new camera(widget.cameras),
new chats(),
new status(),
new calls()
],
),
floatingActionButton: buildFloatingActionButton(selectedfab),
);
}
Widget buildFloatingActionButton(_fab page) {
if (!page.fabDefined) return null;
return new FloatingActionButton(
key: page.fabKey,
backgroundColor: Theme.of(context).accentColor,
child: new Icon(page.fabIcon.icon, color: Colors.white),
onPressed: () => startAction(page),
elevation: 0.6,
);
}
void startAction(_fab page) {
switch (page.label) {
case "chats":
Navigator.of(context).push(new MaterialPageRoute(builder: (context) {
// return new contacts();
return new Contacts();
}));
break;
case "status":
Navigator.of(context).push(new MaterialPageRoute(builder: (context) {
print("clicled");
return new camera_full();
}));
break;
case "calls":
Navigator.of(context).push(new MaterialPageRoute(builder: (context) {
print("clicled");
return new new_call();
}));
}
}
}
class _fab {
_fab({this.label, this.icon});
final IconData icon;
final String label;
Icon get fabIcon => new Icon(icon);
bool get fabDefined => icon != null;
Key get fabKey => new ValueKey<Icon>(fabIcon);
//Key get fabKey => new ValueKey<Color>(fabColor);
}
List<_fab> fablist = [
new _fab(icon: null),
new _fab(
label: "chats",
icon: Icons.message,
),
new _fab(label: "status", icon: Icons.photo_camera),
new _fab(label: "calls", icon: Icons.add_call),
];
| 0
|
mirrored_repositories/WhatsAppUIClone/lib
|
mirrored_repositories/WhatsAppUIClone/lib/view/Profile.dart
|
import 'package:flutter/material.dart';
class ProfileView extends StatelessWidget {
final String name;
final String imgurl;
ProfileView(this.name, this.imgurl);
@override
Widget build(BuildContext context) {
return new Scaffold(
body: new CustomScrollView(
slivers: <Widget>[
new SliverAppBar(
expandedHeight: 350.0,
floating: false,
pinned: true,
flexibleSpace: new FlexibleSpaceBar(
title: new Text(name),
background: new Stack(
fit: StackFit.expand,
children: <Widget>[
new Image.network(
imgurl,
fit: BoxFit.cover,
),
],
),
),
),
new SliverList(
delegate: new SliverChildListDelegate(<Widget>[
new ListTile(
title: new Text("Mute notifications"),
trailing: new Switch(
value: false,
onChanged: null,
inactiveThumbColor: Theme.of(context).primaryColor,
),
),
new ListTile(title: new Text("Custom notifications")),
new ListTile(
title: new Text("Encryption"),
subtitle: new Text(
"Message to this chat and calls sre secured with end-to-end encryption. Tap to verify"),
trailing: new Icon(
Icons.lock,
color: Theme.of(context).primaryColor,
),
),
new Padding(padding: const EdgeInsets.symmetric(vertical: 10.0)),
new Text(
" About and phone number",
style: new TextStyle(color: Theme.of(context).primaryColor),
),
new ListTile(
title: new Text("Hey there! I am using WhatsApp"),
subtitle: new Text("15 may"),
),
new ListTile(
title: new Text("+91 98765 43210"),
trailing: new Row(
children: <Widget>[
new Icon(
Icons.message,
color: Theme.of(context).primaryColor,
),
new Padding(
padding: const EdgeInsets.symmetric(horizontal: 10.0),
),
new Icon(
Icons.call,
color: Theme.of(context).primaryColor,
),
new Padding(
padding: const EdgeInsets.symmetric(horizontal: 10.0)),
new Icon(Icons.videocam,
color: Theme.of(context).primaryColor),
],
),
),
new Text(
" Groups in common",
style: new TextStyle(color: Theme.of(context).primaryColor),
),
new ListTile(
leading: new CircleAvatar(
backgroundImage: new NetworkImage(imgurl),
),
title: new Text("Group 1"),
subtitle: new Text("Member1, Member2..."),
),
new ListTile(
leading: new CircleAvatar(
backgroundImage: new NetworkImage(imgurl),
),
title: new Text("Group 2"),
subtitle: new Text("Member1, Member2..."),
),
new ListTile(
leading: new CircleAvatar(
backgroundImage: new NetworkImage(imgurl),
),
title: new Text("Group 3"),
subtitle: new Text("Member1, Member2..."),
),
new ListTile(
leading: new Icon(
Icons.block,
color: Colors.red,
),
title: new Text(
"Block",
style: new TextStyle(color: Colors.red),
),
),
new ListTile(
leading: new Icon(
Icons.thumb_down,
color: Colors.red,
),
title: new Text(
"Report spam",
style: new TextStyle(color: Colors.red),
),
)
]),
)
],
),
);
}
}
| 0
|
mirrored_repositories/WhatsAppUIClone/lib
|
mirrored_repositories/WhatsAppUIClone/lib/view/new_call.dart
|
import 'package:flutter/material.dart';
import 'package:whatsappclone/model/contacts_model.dart';
class new_call extends StatefulWidget {
@override
State<StatefulWidget> createState() => new newCallState();
}
class newCallState extends State<new_call> {
@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(
title: new Text("Select contact"),
actions: <Widget>[
new Icon(Icons.search),
new Padding(padding: const EdgeInsets.symmetric(horizontal: 10.0)),
new Icon(Icons.person_add),
new Padding(padding: const EdgeInsets.symmetric(horizontal: 10.0)),
new Icon(Icons.more_vert),
],
),
body: new ListView.builder(
itemCount: cont.length,
itemBuilder: (context, l) => new Column(
children: <Widget>[
new Divider(
height: 10.0,
),
new ListTile(
leading: new CircleAvatar(
foregroundColor: Theme.of(context).accentColor,
backgroundColor: Colors.grey,
backgroundImage: new NetworkImage(cont[l].imgurl),
),
title: new Text(
cont[l].name,
style: new TextStyle(fontWeight: FontWeight.bold),
),
subtitle: new Text(
"MOBILE",
style: new TextStyle(
color: Theme.of(context).accentColor, fontSize: 12.0),
),
trailing: new Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
new Icon(
Icons.call,
color: Theme.of(context).primaryColor,
),
new Padding(
padding:
const EdgeInsets.symmetric(horizontal: 15.0)),
new Icon(
Icons.videocam,
color: Theme.of(context).primaryColor,
)
],
),
),
],
)),
);
}
}
| 0
|
mirrored_repositories/WhatsAppUIClone/lib
|
mirrored_repositories/WhatsAppUIClone/lib/view/ChatScreen.dart
|
import 'package:flutter/material.dart';
import 'package:whatsappclone/view/Profile.dart';
class ChatScreen extends StatefulWidget {
final String name;
final String imgurl;
ChatScreen(this.name, this.imgurl);
@override
State<StatefulWidget> createState() => _chatState();
}
class _chatState extends State<ChatScreen> {
@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(
titleSpacing: -15.0,
title: new Row(
children: <Widget>[
new FlatButton.icon(
icon: new CircleAvatar(
backgroundImage: new NetworkImage(widget.imgurl)),
label: new Text(
widget.name,
style: new TextStyle(color: Colors.white, fontSize: 18.0),
),
onPressed: () => Navigator
.of(context)
.push(new MaterialPageRoute(builder: (context) {
return new ProfileView(widget.name, widget.imgurl);
})),
),
// new Text(widget.name),
],
),
actions: <Widget>[
new Icon(Icons.videocam),
new Padding(
padding: const EdgeInsets.symmetric(horizontal: 10.0),
),
new Icon(Icons.call),
new Padding(
padding: const EdgeInsets.symmetric(horizontal: 10.0),
),
new Icon(Icons.more_vert)
],
),
body: new Container(
decoration: new BoxDecoration(
image: new DecorationImage(
image: new NetworkImage(
"https://i.pinimg.com/originals/8f/ba/cb/8fbacbd464e996966eb9d4a6b7a9c21e.jpg"),
fit: BoxFit.fitWidth)),
child: new Column(
children: <Widget>[
new Flexible(child: new Container()),
new Row(children: <Widget>[
new Flexible(
child: new Container(
padding:
const EdgeInsets.symmetric(horizontal: 4.0, vertical: 8.0),
child: new Theme(
data: Theme.of(context).copyWith(primaryColor: Colors.white),
child: new TextField(
decoration: new InputDecoration(
prefixIcon:
new Icon(Icons.insert_emoticon, color: Colors.grey),
hintText: "Type a message",
suffixIcon: new Icon(
Icons.camera_alt,
color: Colors.grey,
),
border: OutlineInputBorder(
borderRadius:
const BorderRadius.all(const Radius.circular(30.0)),
),
fillColor: Colors.white,
filled: true,
),
),
),
)),
new Container(
padding: const EdgeInsets.symmetric(horizontal: 4.0),
child: new IconButton(
icon: new Icon(
Icons.mic,
color: Colors.white,
),
onPressed: null),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Theme.of(context).primaryColor,
),
)
])
],
),
),
); //modified
}
}
| 0
|
mirrored_repositories/WhatsAppUIClone/lib
|
mirrored_repositories/WhatsAppUIClone/lib/view/Contacts.dart
|
import "package:flutter/material.dart";
import 'package:whatsappclone/model/contacts_model.dart';
class Contacts extends StatefulWidget {
@override
State<StatefulWidget> createState() => new _stateContacts();
}
class _stateContacts extends State<Contacts> {
@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(
title: new Text("Select Contacts"),
actions: <Widget>[
new Icon(Icons.search),
new Padding(padding: const EdgeInsets.symmetric(horizontal: 10.0)),
new Icon(Icons.person_add),
new Padding(padding: const EdgeInsets.symmetric(horizontal: 10.0)),
new Icon((Icons.more_vert))
],
),
body: new ListView.builder(
itemCount: cont.length,
itemBuilder: (context, l) => new Column(
children: <Widget>[
new Divider(
height: 10.0,
),
new ListTile(
leading: new CircleAvatar(
foregroundColor: Theme.of(context).accentColor,
backgroundColor: Colors.grey,
backgroundImage: new NetworkImage(cont[l].imgurl),
),
title: new Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
new Text(
cont[l].name,
style: new TextStyle(fontWeight: FontWeight.bold),
),
new Text(
cont[l].type,
style: new TextStyle(
color: Theme.of(context).accentColor,
fontSize: 12.0),
),
]),
subtitle: new Container(
padding: const EdgeInsets.only(top: 5.0),
child: new Text(cont[l].status,
style: new TextStyle(
color: Colors.grey, fontSize: 14.0)),
),
),
],
),
));
}
}
| 0
|
mirrored_repositories/WhatsAppUIClone/lib
|
mirrored_repositories/WhatsAppUIClone/lib/view/camera_full.dart
|
import 'package:flutter/material.dart';
import 'package:camera/camera.dart';
import 'dart:async';
class camera_full extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return new CameraState();
}
}
class CameraState extends State<camera_full> {
List<CameraDescription> cameras;
CameraController controller;
bool _isReady = false;
@override
void initState() {
super.initState();
_setupCameras();
}
Future<void> _setupCameras() async {
try {
// initialize cameras.
cameras = await availableCameras();
// initialize camera controllers.
controller = new CameraController(cameras[0], ResolutionPreset.medium);
await controller.initialize();
} on CameraException catch (_) {
// do something on error.
}
if (!mounted) return null;
setState(() {
_isReady = true;
});
}
@override
Widget build(BuildContext context) {
if (!_isReady) {
print("null camera");
return new Container();
}
return new Scaffold(
body: new AspectRatio(
aspectRatio: controller.value.aspectRatio,
child: CameraPreview(controller),
),
);
}
@override
void dispose() {
controller?.dispose();
super.dispose();
}
}
| 0
|
mirrored_repositories/WhatsAppUIClone/lib
|
mirrored_repositories/WhatsAppUIClone/lib/pages/status.dart
|
import 'package:flutter/material.dart';
import 'package:whatsappclone/model/status_model.dart';
class status extends StatefulWidget {
@override
State<StatefulWidget> createState() => new _statusState();
}
class _statusState extends State<status> {
@override
Widget build(BuildContext context) {
return new Scaffold(
body: new ListView(children: <Widget>[
new ListTile(
leading: new CircleAvatar(
foregroundColor: Theme.of(context).accentColor,
backgroundColor: Colors.grey,
backgroundImage: new NetworkImage(
"https://www.includehelp.com/Members/images/aman-gautam.jpg"),
),
title: new Text(
"My status",
style: new TextStyle(fontWeight: FontWeight.bold),
),
subtitle: new Text("Tap to add status update"),
),
new Text(
"Recent updates",
style: new TextStyle(
fontWeight: FontWeight.bold, color: Theme.of(context).primaryColor),
),
new ListTile(
leading: new CircleAvatar(
foregroundColor: Theme.of(context).accentColor,
backgroundColor: Colors.grey,
backgroundImage: new NetworkImage(stat[1].imgurl),
),
title: new Text(
stat[1].name,
style: new TextStyle(
fontWeight: FontWeight.bold,
),
),
subtitle: new Container(
padding: const EdgeInsets.only(top: 5.0),
child: new Text(stat[1].time,
style: new TextStyle(color: Colors.grey, fontSize: 15.0)),
),
),
new Divider(),
new ListTile(
leading: new CircleAvatar(
foregroundColor: Theme.of(context).accentColor,
backgroundColor: Colors.grey,
backgroundImage: new NetworkImage(stat[2].imgurl),
),
title: new Text(
stat[2].name,
style: new TextStyle(
fontWeight: FontWeight.bold,
),
),
subtitle: new Container(
padding: const EdgeInsets.only(top: 5.0),
child: new Text(stat[2].time,
style: new TextStyle(color: Colors.grey, fontSize: 15.0)),
),
),
]));
}
}
| 0
|
mirrored_repositories/WhatsAppUIClone/lib
|
mirrored_repositories/WhatsAppUIClone/lib/pages/chats.dart
|
import 'package:flutter/material.dart';
import 'package:whatsappclone/view/ChatScreen.dart';
import 'package:whatsappclone/model/chat_model.dart';
class chats extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return new ChatState();
}
}
class ChatState extends State<chats> {
@override
Widget build(BuildContext context) {
return new ListView.builder(
itemCount: dummy.length,
itemBuilder: (context, l) => new Column(
children: <Widget>[
new Divider(
height: 10.0,
),
new ListTile(
leading: new CircleAvatar(
foregroundColor: Theme.of(context).accentColor,
backgroundColor: Colors.grey,
backgroundImage: new NetworkImage(dummy[l].avatarUrl),
),
title: new Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
new Text(
dummy[l].name,
style: new TextStyle(fontWeight: FontWeight.bold),
),
new Text(
dummy[l].time,
style:
new TextStyle(color: Colors.grey, fontSize: 14.0),
),
],
),
subtitle: new Container(
padding: const EdgeInsets.only(top: 5.0),
child: new Text(dummy[l].message,
style:
new TextStyle(color: Colors.grey, fontSize: 15.0)),
),
onTap: () => Navigator
.of(context)
.push(new MaterialPageRoute(builder: (context) {
return new ChatScreen(
dummy[l].name, dummy[l].avatarUrl);
})),
)
],
));
}
}
| 0
|
mirrored_repositories/WhatsAppUIClone/lib
|
mirrored_repositories/WhatsAppUIClone/lib/pages/camera.dart
|
import 'package:flutter/material.dart';
import 'package:camera/camera.dart';
class camera extends StatefulWidget {
List<CameraDescription> cameras;
camera(this.cameras);
@override
State<StatefulWidget> createState() {
return new CameraState();
}
}
class CameraState extends State<camera> {
CameraController controller;
@override
void initState() {
super.initState();
controller = CameraController(widget.cameras[0], ResolutionPreset.medium);
controller.initialize().then((_) {
if (mounted) return;
setState(() {});
});
}
@override
Widget build(BuildContext context) {
if (!controller.value.initialized) {
print("not connected");
return new Container();
}
return new Container(
child: new AspectRatio(
aspectRatio: controller.value.aspectRatio,
child: CameraPreview(controller),
));
}
@override
void dispose() {
controller?.dispose();
super.dispose();
}
}
| 0
|
mirrored_repositories/WhatsAppUIClone/lib
|
mirrored_repositories/WhatsAppUIClone/lib/pages/calls.dart
|
import 'package:flutter/material.dart';
import 'package:whatsappclone/model/calls_model.dart';
class calls extends StatefulWidget {
@override
State<StatefulWidget> createState() => new _callsState();
}
class _callsState extends State<calls> {
@override
Widget build(BuildContext context) {
return new ListView.builder(
itemCount: dummc.length,
itemBuilder: (context, i) => new Column(
children: <Widget>[
new Divider(
height: 10.0,
),
new ListTile(
leading: new CircleAvatar(
foregroundColor: Theme.of(context).accentColor,
backgroundColor: Colors.grey,
backgroundImage: new NetworkImage(dummc[i].imgurl),
),
title: new Text(
dummc[i].name,
style: new TextStyle(fontWeight: FontWeight.bold),
),
subtitle: new Container(
padding: const EdgeInsets.only(top: 5.0),
child: new Row(
children: <Widget>[
dummc[i].st, //type1
new Text(dummc[i].time,
style: new TextStyle(
color: Colors.grey, fontSize: 15.0)),
],
)),
trailing: new Icon(
dummc[i].type.icon,
color: Theme.of(context).primaryColor,
), //type 2
)
],
));
}
}
| 0
|
mirrored_repositories/WhatsAppUIClone/lib
|
mirrored_repositories/WhatsAppUIClone/lib/model/status_model.dart
|
import 'package:flutter/material.dart';
class StatusModel {
final String imgurl;
final String name;
final String time;
StatusModel({this.name, this.time, this.imgurl});
}
List<StatusModel> stat = [
new StatusModel(
name: "Aman gautam",
time: "Today,3:00AM",
imgurl: "https://www.includehelp.com/Members/images/aman-gautam.jpg"),
new StatusModel(
name: "Hero",
time: "Today, 4:23AM",
imgurl:
"https://pbs.twimg.com/profile_images/760249570085314560/yCrkrbl3_400x400.jpg"),
new StatusModel(
name: "Mack",
time: "Today, 5:23PM",
imgurl:
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTB0qsqzuV2X3LCCSeJujDyK8vg5SIz1JNAP-f5N_Tc2MQsNEEWGA"),
new StatusModel(
name: "Alexa",
time: "Yesterday, 4:43PM",
imgurl:
"https://pbs.twimg.com/profile_images/927446347879292930/Fi0D7FGJ_400x400.jpg"),
];
| 0
|
mirrored_repositories/WhatsAppUIClone/lib
|
mirrored_repositories/WhatsAppUIClone/lib/model/contacts_model.dart
|
import 'package:flutter/material.dart';
class Contact {
String imgurl;
final String name;
final String status;
final String type;
Contact({this.name, this.type, this.status, this.imgurl});
}
List<Contact> cont = [
new Contact(
name: "Aman gautam",
type: "MOBILE",
status: "never give up....",
imgurl: "https://www.includehelp.com/Members/images/aman-gautam.jpg",
),
new Contact(
name: "Henal",
type: "MOBILE",
status: "faltu admi ",
imgurl:
"https://pbs.twimg.com/profile_images/760249570085314560/yCrkrbl3_400x400.jpg",
),
new Contact(
name: "Champ",
type: "MOBILE",
status: "too much fun.",
imgurl:
"https://pbs.twimg.com/profile_images/927446347879292930/Fi0D7FGJ_400x400.jpg",
),
new Contact(
name: "John",
type: "MOBILE",
status: "Busy.....",
imgurl:
"https://pbs.twimg.com/profile_images/760249570085314560/yCrkrbl3_400x400.jpg",
),
new Contact(
name: "Alexa",
type: "MOBILE",
status: "Hey there ! i am using Whatsapp.",
imgurl:
"https://pbs.twimg.com/profile_images/927446347879292930/Fi0D7FGJ_400x400.jpg",
),
new Contact(
name: "Mack",
type: "MOBILE",
status: "too much fun.",
imgurl:
"https://pbs.twimg.com/profile_images/760249570085314560/yCrkrbl3_400x400.jpg",
),
new Contact(
name: "Hero",
type: "MOBILE",
status: "Busy",
imgurl:
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTB0qsqzuV2X3LCCSeJujDyK8vg5SIz1JNAP-f5N_Tc2MQsNEEWGA",
),
new Contact(
name: "Alen",
type: "MOBILE",
status: "no more talk.",
imgurl:
"https://pbs.twimg.com/profile_images/760249570085314560/yCrkrbl3_400x400.jpg",
),
new Contact(
name: "Disaz",
type: "MOBILE",
status: "too much fun.",
imgurl:
"https://pbs.twimg.com/profile_images/927446347879292930/Fi0D7FGJ_400x400.jpg",
),
];
| 0
|
mirrored_repositories/WhatsAppUIClone/lib
|
mirrored_repositories/WhatsAppUIClone/lib/model/calls_model.dart
|
import 'package:flutter/material.dart';
class CallModel {
final String imgurl;
final String name;
final String time;
final Icon type;
final Icon st;
CallModel({this.name, this.time, this.imgurl, this.st, this.type});
}
List<CallModel> dummc = [
new CallModel(
name: "Jack",
time: "Today, 4:33AM",
imgurl:
"https://pbs.twimg.com/profile_images/760249570085314560/yCrkrbl3_400x400.jpg",
st: new Icon(Icons.call_made, color: Colors.green),
type: new Icon(
Icons.phone,
)),
new CallModel(
name: "Hero",
time: "Today, 2:52AM",
imgurl:
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTB0qsqzuV2X3LCCSeJujDyK8vg5SIz1JNAP-f5N_Tc2MQsNEEWGA",
st: new Icon(Icons.call_received, color: Colors.green),
type: new Icon(Icons.videocam)),
new CallModel(
name: "John",
time: "Today, 1:32AM",
imgurl:
"https://pbs.twimg.com/profile_images/760249570085314560/yCrkrbl3_400x400.jpg",
st: new Icon(Icons.call_received, color: Colors.red),
type: new Icon(Icons.phone)),
];
| 0
|
mirrored_repositories/WhatsAppUIClone/lib
|
mirrored_repositories/WhatsAppUIClone/lib/model/chat_model.dart
|
class ChatModel {
final String name;
final String message;
final String time;
final String avatarUrl;
ChatModel({this.name, this.message, this.time, this.avatarUrl});
}
List<ChatModel> dummy = [
new ChatModel(
name: "Aman gautam",
message: "this is going well",
time: "2:00 AM",
avatarUrl: "https://www.includehelp.com/Members/images/aman-gautam.jpg"),
new ChatModel(
name: "Hero",
message: "good",
time: "3:00 AM",
avatarUrl:
"https://pbs.twimg.com/profile_images/760249570085314560/yCrkrbl3_400x400.jpg"),
new ChatModel(
name: "Alen",
message: "thanks",
time: "6:00 AM",
avatarUrl:
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTB0qsqzuV2X3LCCSeJujDyK8vg5SIz1JNAP-f5N_Tc2MQsNEEWGA"),
new ChatModel(
name: "Disaz",
message: "Hehe",
time: "2:03 PM",
avatarUrl:
"https://pbs.twimg.com/profile_images/760249570085314560/yCrkrbl3_400x400.jpg"),
new ChatModel(
name: "Alexa",
message: "dude",
time: "3:20 AM",
avatarUrl:
"https://pbs.twimg.com/profile_images/927446347879292930/Fi0D7FGJ_400x400.jpg"),
new ChatModel(
name: "Mack",
message: "Hey, you are doing god",
time: "3:00 AM",
avatarUrl:
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTB0qsqzuV2X3LCCSeJujDyK8vg5SIz1JNAP-f5N_Tc2MQsNEEWGA"),
new ChatModel(
name: "Jack",
message: "thanks",
time: "6:00 AM",
avatarUrl:
"https://pbs.twimg.com/profile_images/760249570085314560/yCrkrbl3_400x400.jpg"),
new ChatModel(
name: "John",
message: "thalaiva",
time: "2:50 PM",
avatarUrl:
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTB0qsqzuV2X3LCCSeJujDyK8vg5SIz1JNAP-f5N_Tc2MQsNEEWGA"),
new ChatModel(
name: "Champ",
message: "hoorah",
time: "2:03 PM",
avatarUrl:
"https://pbs.twimg.com/profile_images/760249570085314560/yCrkrbl3_400x400.jpg")
];
| 0
|
mirrored_repositories/WhatsAppUIClone
|
mirrored_repositories/WhatsAppUIClone/test/widget_test.dart
|
// This is a basic Flutter widget test.
// To perform an interaction with a widget in your test, use the WidgetTester utility that Flutter
// provides. For example, you can send tap and scroll gestures. You can also use WidgetTester to
// find child widgets in the widget tree, read text, and verify that the values of widget properties
// are correct.
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:whatsappclone/main.dart';
void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(new MyApp());
// Verify that our counter starts at 0.
expect(find.text('0'), findsOneWidget);
expect(find.text('1'), findsNothing);
// Tap the '+' icon and trigger a frame.
await tester.tap(find.byIcon(Icons.add));
await tester.pump();
// Verify that our counter has incremented.
expect(find.text('0'), findsNothing);
expect(find.text('1'), findsOneWidget);
});
}
| 0
|
mirrored_repositories/Blue-Waves-Flutter
|
mirrored_repositories/Blue-Waves-Flutter/lib/constants.dart
|
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:google_sign_in/google_sign_in.dart';
import 'package:logger/logger.dart';
typedef Json = Map<String, dynamic>;
Logger log = Logger();
BoxShadow kSmallShadow = BoxShadow(
blurRadius: 4.0.r,
spreadRadius: -1.r,
);
///```dart
/// fontSize: 20.sp,
/// color: kColorWhite,
///```
TextStyle kStyleDefault = TextStyle(
fontSize: 20.sp,
color: kColorWhite,
fontFamily: 'AdventPro',
);
///```dart
/// fontSize: 20.sp,
/// color: kColorWhite,
/// fontWeight: FontWeight.w700
///```
TextStyle kStyleDefaultBold = TextStyle(
fontSize: 20.sp,
color: kColorWhite,
fontWeight: FontWeight.w700,
fontFamily: 'AdventPro',
);
GoogleSignIn googleSignIn = GoogleSignIn(
scopes: <String>[
'email',
],
);
Future<UserCredential?> googleSign() async {
try {
// Trigger the authentication flow
final googleUser = await googleSignIn.signIn();
// Obtain the auth details from the request
final googleAuth = await googleUser?.authentication;
// Create a new credential
final credential = GoogleAuthProvider.credential(
accessToken: googleAuth!.accessToken,
idToken: googleAuth.idToken,
);
// Once signed in, return the UserCredential
final user = await FirebaseAuth.instance.signInWithCredential(credential);
return user;
} catch (error) {
log.e(error);
return null;
}
}
/// ```dart
/// const Color(0xff252525);
/// ```
Color kColorBlack = const Color(0xff252525);
/// ```dart
/// const Color(0xff081422);
/// ```
Color kColorBlueDark2 = const Color(0xff081422);
/// ```dart
/// const Color(0xff150485);
/// ```
Color kColorBlueDark = const Color(0xff150485);
/// ```dart
/// const Color(0xff31326F);
/// ```
Color kColorPurpleDark = const Color(0xff31326F);
/// ```dart
/// const Color(0xff005295);
/// ```
Color kColorBlue = const Color(0xff005295);
/// ```dart
/// const Color(0xff34626C);
/// ```
Color kColorGreenArmy = const Color(0xff34626C);
/// ```dart
/// const Color(0xff1AA6B7);
/// ```
Color kColorBlueLight = const Color(0xff1AA6B7);
/// ```dart
/// const Color(0xff18A6EC);
/// ```
Color kColorBlueLight2 = const Color(0xff18A6EC);
/// ```dart
/// const Color(0xff709FB0);
/// ```
Color kColorGreenLight = const Color(0xff709FB0);
/// ```dart
/// const Color(0xff9DDAC6);
/// ```
Color kColorGreelLight2 = const Color(0xff9DDAC6);
/// ```dart
/// const Color(0xffEAA819);
/// ```
Color kColorOrange = const Color(0xffEAA819);
/// ```dart
/// Colors.orange[200];
/// ```
Color? kColorOrangeLight2 = Colors.orange[200];
/// ```dart
/// Colors.orange[50];
/// ```
Color? kColorOrangeLight = Colors.orange[50];
/// ```dart
/// const Color(0xffF9F9F9);
/// ```
Color kColorWhite = const Color(0xffF9F9F9);
| 0
|
mirrored_repositories/Blue-Waves-Flutter
|
mirrored_repositories/Blue-Waves-Flutter/lib/firebase_options.dart
|
// File generated by FlutterFire CLI.
// ignore_for_file: lines_longer_than_80_chars, avoid_classes_with_only_static_members
import 'package:firebase_core/firebase_core.dart' show FirebaseOptions;
import 'package:flutter/foundation.dart'
show defaultTargetPlatform, kIsWeb, TargetPlatform;
/// Default [FirebaseOptions] for use with your Firebase apps.
///
/// Example:
/// ```dart
/// import 'firebase_options.dart';
/// // ...
/// await Firebase.initializeApp(
/// options: DefaultFirebaseOptions.currentPlatform,
/// );
/// ```
class DefaultFirebaseOptions {
static FirebaseOptions get currentPlatform {
if (kIsWeb) {
return web;
}
switch (defaultTargetPlatform) {
case TargetPlatform.android:
return android;
case TargetPlatform.iOS:
throw UnsupportedError(
'DefaultFirebaseOptions have not been configured for ios - '
'you can reconfigure this by running the FlutterFire CLI again.',
);
case TargetPlatform.macOS:
throw UnsupportedError(
'DefaultFirebaseOptions have not been configured for macos - '
'you can reconfigure this by running the FlutterFire CLI again.',
);
case TargetPlatform.windows:
throw UnsupportedError(
'DefaultFirebaseOptions have not been configured for windows - '
'you can reconfigure this by running the FlutterFire CLI again.',
);
case TargetPlatform.linux:
throw UnsupportedError(
'DefaultFirebaseOptions have not been configured for linux - '
'you can reconfigure this by running the FlutterFire CLI again.',
);
default:
throw UnsupportedError(
'DefaultFirebaseOptions are not supported for this platform.',
);
}
}
static const FirebaseOptions web = FirebaseOptions(
apiKey: 'AIzaSyC8wCskdlVyOLFHjUU-V6mKiIMxAiTvaHU',
appId: '1:756007824842:web:ba90ff686a478b22743333',
messagingSenderId: '756007824842',
projectId: 'blue-waves-771db',
authDomain: 'blue-waves-771db.firebaseapp.com',
databaseURL: 'https://blue-waves-771db.firebaseio.com',
storageBucket: 'blue-waves-771db.appspot.com',
measurementId: 'G-MS9L985ZR1',
);
static const FirebaseOptions android = FirebaseOptions(
apiKey: 'AIzaSyAvATFR-c5DsubGTFieYN54to1kjymIf14',
appId: '1:756007824842:android:e44e3b1e7daee069743333',
messagingSenderId: '756007824842',
projectId: 'blue-waves-771db',
databaseURL: 'https://blue-waves-771db.firebaseio.com',
storageBucket: 'blue-waves-771db.appspot.com',
);
}
| 0
|
mirrored_repositories/Blue-Waves-Flutter
|
mirrored_repositories/Blue-Waves-Flutter/lib/main.dart
|
import 'package:blue_waves/generated/l10n.dart';
import 'package:blue_waves/pages/globe_view.dart';
import 'package:blue_waves/states/app_config.dart';
import 'package:blue_waves/states/loading_state.dart';
import 'package:blue_waves/states/theme_state.dart';
import 'package:firebase_analytics/firebase_analytics.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_crashlytics/firebase_crashlytics.dart';
import 'package:firebase_remote_config/firebase_remote_config.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
// import 'package:firebase_crashlytics/firebase_crashlytics.dart';
import 'package:flutter/services.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
//import 'package:onesignal_flutter/onesignal_flutter.dart';
import 'package:package_info/package_info.dart';
import 'package:provider/provider.dart';
import 'package:sentry_flutter/sentry_flutter.dart';
import 'package:supabase_flutter/supabase_flutter.dart';
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp();
AppConfig.instance.versionInformation = await PackageInfo.fromPlatform();
final FirebaseRemoteConfig remoteConfig = FirebaseRemoteConfig.instance;
await remoteConfig.setConfigSettings(
RemoteConfigSettings(
fetchTimeout: const Duration(seconds: 10),
minimumFetchInterval: const Duration(hours: 10),
),
);
if (kDebugMode) {
// Force disable Crashlytics collection while doing every day development.
// Temporarily toggle this to true if you want to test crash reporting in your app.
await FirebaseCrashlytics.instance.setCrashlyticsCollectionEnabled(false);
} else {
FirebaseCrashlytics.instance.setCrashlyticsCollectionEnabled(true);
}
await remoteConfig.fetchAndActivate();
await Supabase.initialize(
url: 'https://xalypheaznoombgcgysf.supabase.co',
anonKey: AppConfig.instance.getSupabaseKey(),
// authCallbackUrlHostname: 'login-callback', // optional
debug: true // optional
,
);
//Remove this method to stop OneSignal Debugging
// OneSignal.shared.setLogLevel(OSLogLevel.verbose, OSLogLevel.none);
// OneSignal.shared.setAppId(AppConfig.instance.getOneSignalId());
// OneSignal.shared.setNotificationWillShowInForegroundHandler(
// (OSNotificationReceivedEvent event) {
// // Will be called whenever a notification is received in foreground
// // Display Notification, pass null param for not displaying the notification
// event.complete(event.notification);
// log.wtf(event);
// });
// OneSignal.shared
// .setNotificationOpenedHandler((OSNotificationOpenedResult result) async {
// log.wtf(result.action?.actionId);
// log.wtf(result.notification.title);
// log.wtf(result.notification.additionalData);
// log.wtf(result.notification.body);
// if (result.notification.title == 'test') {
// Get.to(() => AuthPage());
// }
// // Will be called whenever a notification is opened/button pressed.
// });
// OneSignal.shared.setPermissionObserver((OSPermissionStateChanges changes) {
// // Will be called whenever the permission changes
// // (ie. user taps Allow on the permission prompt in iOS)
// });
// OneSignal.shared
// .setSubscriptionObserver((OSSubscriptionStateChanges changes) {
// // Will be called whenever the subscription changes
// // (ie. user gets registered with OneSignal and gets a user ID)
// });
// OneSignal.shared.setEmailSubscriptionObserver(
// (OSEmailSubscriptionStateChanges emailChanges) {
// // Will be called whenever then user's email subscription changes
// // (ie. OneSignal.setEmail(email) is called and the user gets registered
// });
// // The promptForPushNotificationsWithUserResponse function will show the iOS push notification prompt. We recommend removing the following code and instead using an In-App Message to prompt for notification permission
// OneSignal.shared.promptUserForPushNotificationPermission().then(
// (accepted) {
// log.wtf("Accepted permission: $accepted");
// },
// );
runApp(
MyApp(),
);
if (!kDebugMode) {
await SentryFlutter.init(
(options) {
options.dsn = AppConfig.instance.getSentryDsn();
},
appRunner: () => runApp(
MyApp(),
),
);
}
}
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
// LOCK THE ORIENTATION
SystemChrome.setPreferredOrientations([
DeviceOrientation.portraitUp,
DeviceOrientation.portraitDown,
]);
final analytics = FirebaseAnalytics.instance;
return ScreenUtilInit(
builder: (_, context) => MultiProvider(
providers: [
ListenableProvider<LoadingState>(
create: (_) => LoadingState(
isLoading: true,
),
),
ListenableProvider<ThemeState>(
create: (_) => ThemeState(isDark: false),
),
],
child: GetMaterialApp(
title: 'Blue Waves',
localizationsDelegates: const [
S.delegate,
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
],
supportedLocales: S.delegate.supportedLocales,
debugShowCheckedModeBanner: false,
navigatorObservers: [
FirebaseAnalyticsObserver(analytics: analytics),
SentryNavigatorObserver(),
],
theme: ThemeData(
visualDensity: VisualDensity.adaptivePlatformDensity,
),
initialRoute: '/',
getPages: [
GetPage(
name: '/',
page: () => GlobeView(),
),
],
builder: (context, widget) {
return MediaQuery(
//Setting font does not change with system font size
data: MediaQuery.of(context).copyWith(textScaleFactor: 1.0),
child: widget ?? const SizedBox(),
);
},
),
),
);
}
}
| 0
|
mirrored_repositories/Blue-Waves-Flutter/lib
|
mirrored_repositories/Blue-Waves-Flutter/lib/pages/globe_view.dart
|
import 'dart:async';
import 'dart:ui' as ui;
import 'dart:ui';
import 'package:animations/animations.dart';
import 'package:blue_waves/api/api_service.dart';
import 'package:blue_waves/constants.dart';
import 'package:blue_waves/generated/l10n.dart';
import 'package:blue_waves/models/beach.dart';
import 'package:blue_waves/pages/beach_page/beach_page.dart';
import 'package:blue_waves/pages/components/animated_background/animated_background.dart';
import 'package:blue_waves/pages/components/animated_background/sun_moon.dart';
import 'package:blue_waves/pages/components/animated_background/title.dart';
import 'package:blue_waves/pages/components/loader.dart';
import 'package:blue_waves/pages/components/snack_bar.dart';
import 'package:blue_waves/pages/register_login_page/auth_page.dart';
import 'package:blue_waves/pages/search_beach_page.dart';
import 'package:blue_waves/states/app_config.dart';
import 'package:blue_waves/states/loading_state.dart';
import 'package:blue_waves/states/theme_state.dart';
import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:google_maps_cluster_manager/google_maps_cluster_manager.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
class GlobeView extends StatefulWidget {
@override
_GlobeViewState createState() => _GlobeViewState();
}
class _GlobeViewState extends State<GlobeView> {
late StreamSubscription<ConnectivityResult> _connectionStatus;
final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey(); // Create a key
FirebaseAuth auth = FirebaseAuth.instance;
bool isAdmin = false;
bool? hasConn;
bool searching = false;
late GoogleMapController mapController;
CameraPosition greeceCamera = const CameraPosition(
target: LatLng(38.2, 23.9),
zoom: 6,
);
Marker? beachMarker;
Set<Marker> markers = {};
late BitmapDescriptor myMarker;
String? _mapStyle;
List<Beach> _beaches = [];
late ClusterManager<Beach> _manager;
final _conn = Connectivity().checkConnectivity();
final Stream<ConnectivityResult> _connStream =
Connectivity().onConnectivityChanged;
Future<void> preparePage() async {
_beaches = await Api.instance.getAllBeaches();
_manager.setItems(_beaches);
}
// TODO: Prepare page is called twice on first app open. Needs improvement
/// Method to create a list of Markers and set them to the map.
Future<void> setMapStyle() async {
_mapStyle = ThemeState.of(context).isDark
? await rootBundle.loadString('map_styles.txt')
: await rootBundle.loadString('map_styles_light.txt');
hasConn = await _conn != ConnectivityResult.none;
if (!mounted) return;
if (LoadingState.of(context).isLoading!) {
LoadingState.of(context).toggleLoading();
}
preparePage();
}
void _updateMarkers(Set<Marker> markers) {
log.i('Updated ${markers.length} markers and has connection $hasConn');
if (mounted) {
setState(() {
this.markers = markers;
});
}
}
ClusterManager<Beach> _initClusterManager() {
log.i('Initializing cluster manager');
return ClusterManager<Beach>(
_beaches,
_updateMarkers,
markerBuilder: _markerBuilder,
stopClusteringZoom: 17.0,
);
}
@override
void initState() {
_manager = _initClusterManager();
super.initState();
_connectionStatus = _connStream.listen((ConnectivityResult result) {
log.i('Conn Status Changed :$result');
if (result == ConnectivityResult.none) {
showSnack(
title: S.current.error,
message: S.current.noConnection,
firstColor: Colors.red[200]!,
secondColor: Colors.red,
duration: 3000,
);
}
if (result != ConnectivityResult.none) {
preparePage();
hasConn = result != ConnectivityResult.none;
}
});
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
setMapStyle();
});
}
@override
void dispose() {
super.dispose();
mapController.dispose();
_connectionStatus.cancel();
}
@override
Widget build(BuildContext context) {
return Material(
child: Stack(
children: [
Scaffold(
key: _scaffoldKey,
drawer: AnimatedContainer(
duration: const Duration(milliseconds: 500),
decoration: BoxDecoration(
color: ThemeState.of(context, listen: true).isDark
? kColorBlueDark2
: kColorBlueLight,
borderRadius: BorderRadius.only(
topRight: Radius.circular(22.r),
bottomRight: Radius.circular(22.r),
),
),
width: 200.w,
height: 450.h,
child: Padding(
padding: EdgeInsets.symmetric(
vertical: 12.0.h,
horizontal: 10.w,
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (FirebaseAuth.instance.currentUser != null) ...[
Text(
S.current.logged_as,
style: kStyleDefault.copyWith(
fontSize: 13.sp,
),
),
Text(
FirebaseAuth.instance.currentUser?.displayName ??
'',
style: kStyleDefault,
),
],
if (FirebaseAuth.instance.currentUser != null)
Padding(
padding: EdgeInsets.only(top: 12.0.h),
child: GestureDetector(
onTap: () async {
await FirebaseAuth.instance.signOut();
setState(() {});
},
child: Text(
S.current.logout,
style: kStyleDefault.copyWith(
fontSize: 15.sp,
),
),
),
),
if (FirebaseAuth.instance.currentUser == null)
Text(
S.current.notLogged,
style: kStyleDefault.copyWith(
fontSize: 15.sp,
),
),
],
),
if (FirebaseAuth.instance.currentUser == null)
TextButton(
onPressed: () async {
await Get.to(() => AuthPage());
},
child: Text(
S.current.login,
style: kStyleDefault.copyWith(
fontSize: 15.sp,
),
),
)
else
Text(
S.current.coming_soon,
style: kStyleDefaultBold,
),
Center(
child: Column(
children: [
GestureDetector(
onTap: () async {
_mapStyle = ThemeState.of(context).isDark
? await rootBundle
.loadString('map_styles_light.txt')
: await rootBundle
.loadString('map_styles.txt');
// ignore: use_build_context_synchronously
ThemeState.of(context).toggleTheme();
setState(() {});
},
child: SunMoon(
isDark:
ThemeState.of(context, listen: true).isDark,
),
),
Text(
'${S.current.version} ${AppConfig.instance.versionInformation?.version}',
style: kStyleDefault.copyWith(
fontSize: 14.sp,
color: kColorOrangeLight,
),
),
],
),
),
],
),
),
),
appBar: AppBar(
backgroundColor: ThemeState.of(context, listen: true).isDark
? kColorBlueDark2
: const Color(0xffd8d0a8),
title: const BlueWavesTitle(),
centerTitle: true,
leading: GestureDetector(
onTap: () => _scaffoldKey.currentState?.openDrawer(),
child: Icon(
Icons.menu,
size: 40,
color: ThemeState.of(context, listen: true).isDark
? const Color(0xffd8d0a8)
: kColorBlueDark2,
),
),
actions: [
Padding(
padding: EdgeInsets.only(right: 8.0.w),
child: OpenContainer(
openColor: kColorWhite,
openBuilder: (BuildContext context, VoidCallback _) {
return SearchBeachPage(
onSearchItemTap: (beach) async {
await mapController.animateCamera(
CameraUpdate.newLatLngZoom(
beach.location,
13,
),
);
},
);
},
closedElevation: 12.0,
closedColor: ThemeState.of(context, listen: true).isDark
? kColorBlueDark2
: const Color(0xffd8d0a8),
closedShape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(2.r),
),
closedBuilder:
(BuildContext context, VoidCallback openContainer) {
return Padding(
padding: EdgeInsets.only(left: 5.w, right: 5.w),
child: Icon(
Icons.search,
color: ThemeState.of(context, listen: true).isDark
? const Color(0xffd8d0a8)
: kColorBlueDark2,
),
);
},
),
),
// IconButton(
// onPressed: () => Get.to(() => LocateBeach()),
// icon: Icon(Icons.textsms_sharp),
// ),
],
),
floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat,
body: Stack(
children: [
if (LoadingState.of(context, listen: true).isLoading!)
const AnimatedBackground(),
if (LoadingState.of(context, listen: true).isLoading!)
const Center(child: Loader())
else
StreamBuilder<ConnectivityResult>(
stream: _connStream,
builder: (context, snapshot) {
final c = snapshot.data;
if (hasConn != null) {
if (c == ConnectivityResult.none || !hasConn!) {
return Positioned.fill(
child: ColoredBox(
color: kColorBlack.withOpacity(0.8),
child: Center(
child: Text(
S.current.noConnection,
style: kStyleDefault,
),
),
),
);
}
}
final Completer<GoogleMapController> mapCompleter =
Completer();
return SizedBox(
height: 1.sh,
width: 1.sw,
child: GoogleMap(
key: ValueKey(
ThemeState.of(context, listen: true).isDark,
),
markers: markers,
onTap: (c) {
if (searching) {
setState(() {
searching = !searching;
});
}
},
buildingsEnabled: false,
myLocationButtonEnabled: false,
initialCameraPosition: greeceCamera,
zoomControlsEnabled: false,
onCameraMove: _manager.onCameraMove,
onCameraIdle: _manager.updateMap,
onMapCreated: (GoogleMapController controller) {
mapController = controller;
_manager.setMapId(controller.mapId);
mapController.setMapStyle(_mapStyle);
mapCompleter.complete(controller);
},
),
);
},
),
],
),
),
],
),
);
}
Future<Marker> Function(Cluster<Beach>) get _markerBuilder =>
(cluster) async {
return Marker(
markerId: MarkerId(cluster.getId()),
position: cluster.location,
onTap: cluster.isMultiple
? () async {
if (cluster.count == 2) {
final LatLng latLng_1 = LatLng(
cluster.items.first.location.latitude,
cluster.items.first.location.longitude,
);
final LatLng latLng_2 = LatLng(
cluster.items.last.location.latitude,
cluster.items.last.location.longitude,
);
// Calculate bounds between two geocoords
LatLngBounds bound;
if (latLng_1.latitude > latLng_2.latitude &&
latLng_1.longitude > latLng_2.longitude) {
bound = LatLngBounds(
southwest: latLng_2,
northeast: latLng_1,
);
} else if (latLng_1.longitude > latLng_2.longitude) {
bound = LatLngBounds(
southwest:
LatLng(latLng_1.latitude, latLng_2.longitude),
northeast:
LatLng(latLng_2.latitude, latLng_1.longitude),
);
} else if (latLng_1.latitude > latLng_2.latitude) {
bound = LatLngBounds(
southwest:
LatLng(latLng_2.latitude, latLng_1.longitude),
northeast:
LatLng(latLng_1.latitude, latLng_2.longitude),
);
} else {
bound = LatLngBounds(
southwest: latLng_1,
northeast: latLng_2,
);
}
final CameraUpdate u2 =
CameraUpdate.newLatLngBounds(bound, 50);
await mapController.animateCamera(u2);
} else {
await mapController.animateCamera(
CameraUpdate.newLatLngZoom(cluster.location, 7),
);
}
}
: () {
log.wtf('Tapped on ${cluster.items.first.name}');
},
infoWindow: cluster.isMultiple
? InfoWindow.noText
: InfoWindow(
title: cluster.items.first.name,
onTap: () async {
await Get.to(
() => BeachPage(
beach: cluster.items.first,
),
);
},
),
icon: await _getMarkerBitmap(
cluster.isMultiple ? 110 : 50,
text: cluster.isMultiple ? cluster.count.toString() : null,
),
);
};
Future<BitmapDescriptor> _getMarkerBitmap(int size, {String? text}) async {
final PictureRecorder pictureRecorder = PictureRecorder();
final Canvas canvas = Canvas(pictureRecorder);
final Paint paint1 = Paint()..color = kColorBlueLight;
final Paint paint2 = Paint()..color = kColorOrange;
canvas.drawCircle(Offset(size / 2, size / 2), size / 2.0, paint1);
canvas.drawCircle(Offset(size / 2, size / 2), size / 2.2, paint2);
if (text != null) {
final TextPainter painter =
TextPainter(textDirection: ui.TextDirection.ltr);
painter.text = TextSpan(
text: text,
style: kStyleDefaultBold.copyWith(
fontSize: (size / 3).sp,
color: kColorBlue,
),
);
painter.layout();
painter.paint(
canvas,
Offset(size / 2 - painter.width / 2, size / 2 - painter.height / 2),
);
}
final img = await pictureRecorder.endRecording().toImage(size, size);
// ignore: cast_nullable_to_non_nullable
final data = await img.toByteData(format: ImageByteFormat.png) as ByteData;
return BitmapDescriptor.fromBytes(data.buffer.asUint8List());
}
}
| 0
|
mirrored_repositories/Blue-Waves-Flutter/lib
|
mirrored_repositories/Blue-Waves-Flutter/lib/pages/search_beach_page.dart
|
import 'package:blue_waves/api/api_service.dart';
import 'package:blue_waves/constants.dart';
import 'package:blue_waves/generated/l10n.dart';
import 'package:blue_waves/models/beach.dart';
import 'package:blue_waves/pages/components/loader.dart';
import 'package:blue_waves/states/theme_state.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_typeahead/flutter_typeahead.dart';
import 'package:get/get.dart';
import 'package:string_extensions/string_extensions.dart';
class SearchBeachPage extends StatefulWidget {
const SearchBeachPage({
required this.onSearchItemTap,
super.key,
});
final Function(Beach) onSearchItemTap;
@override
State<SearchBeachPage> createState() => _SearchBeachPageState();
}
class _SearchBeachPageState extends State<SearchBeachPage> {
final FocusNode _searchTextFocus = FocusNode();
@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
child: LayoutBuilder(
builder: (context, constraints) => SizedBox(
height: constraints.maxHeight,
width: 1.sw,
child: Stack(
children: [
Positioned.fill(
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
log.wtf('getting back');
Get.back();
},
child: Container(
color: ThemeState.of(context, listen: true).isDark
? kColorBlueDark2
: const Color(0xffd8d0a8),
),
),
),
TypeAheadField<Beach>(
minCharsForSuggestions: 3,
loadingBuilder: (context) => const Loader(),
suggestionsBoxVerticalOffset: 0,
textFieldConfiguration: TextFieldConfiguration(
autofocus: true,
focusNode: _searchTextFocus
..addListener(() {
if (!_searchTextFocus.hasFocus) {
Get.back();
}
}),
style: kStyleDefault.copyWith(
color: kColorBlack,
),
cursorColor: kColorBlueDark,
decoration: const InputDecoration(
border: UnderlineInputBorder(),
fillColor: Colors.white,
filled: true,
focusedBorder: InputBorder.none,
),
),
suggestionsCallback: (pattern) =>
Api.instance.searchBeach(name: pattern.replaceGreek!),
itemBuilder: (context, Beach suggestion) {
return ListTile(
tileColor: Colors.white,
title: Text(suggestion.name),
subtitle: Text(suggestion.nameEn ?? suggestion.name),
trailing: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(S.current.rating),
if (suggestion.averageRating != 0.0)
Text(suggestion.averageRating.toString())
else
const Text('N/A')
],
),
);
},
noItemsFoundBuilder: (c) => ListTile(
tileColor: Colors.white,
title: Text(S.current.no_beaches_found),
),
onSuggestionSelected: (suggestion) async {
Get.back();
widget.onSearchItemTap(suggestion);
},
suggestionsBoxDecoration: SuggestionsBoxDecoration(
shadowColor: ThemeState.of(context, listen: true).isDark
? const Color(0xffd8d0a8)
: kColorBlueDark2.withOpacity(0.5),
),
),
],
),
),
),
),
);
}
}
| 0
|
mirrored_repositories/Blue-Waves-Flutter/lib/pages
|
mirrored_repositories/Blue-Waves-Flutter/lib/pages/beach_page/beach_page.dart
|
// ignore_for_file: dead_code
import 'dart:async';
import 'package:animate_do/animate_do.dart';
import 'package:blue_waves/api/api_service.dart';
import 'package:blue_waves/constants.dart';
import 'package:blue_waves/generated/l10n.dart';
import 'package:blue_waves/models/beach.dart';
import 'package:blue_waves/models/photo.dart';
import 'package:blue_waves/pages/beach_page/beach_image_wrapper.dart';
import 'package:blue_waves/pages/components/loader.dart';
import 'package:blue_waves/states/loading_state.dart';
import 'package:blue_waves/states/theme_state.dart';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:string_extensions/string_extensions.dart';
class BeachPage extends StatefulWidget {
const BeachPage({required this.beach});
final Beach beach;
@override
_BeachPageState createState() => _BeachPageState();
}
class _BeachPageState extends State<BeachPage> {
final Completer<GoogleMapController> _controller = Completer();
late GoogleMapController mapController;
late CameraPosition beachPlace;
final PageController _imageController = PageController(viewportFraction: 0.8);
Marker? beachMarker;
double? chosenRating;
double ratingSum = 0;
double actualRating = 0;
List<Photo> images = [];
int totalRatings = 0;
int currentIndex = 1;
bool hasUserRated = false;
bool verticalGallery = false;
bool isLoading = false;
bool isBeachFavorited = false;
String? _mapStyle;
Future<void> open(BuildContext context, int index) async {
await Get.to(
() => GalleryPhotoViewWrapper(
images: images,
backgroundDecoration: const BoxDecoration(
color: Color(0xff005295),
),
initialIndex: index,
scrollDirection: verticalGallery ? Axis.vertical : Axis.horizontal,
),
);
}
Future<void> setMapStyle() async {
_mapStyle = ThemeState.of(context).isDark
? await rootBundle.loadString('map_styles.txt')
: await rootBundle.loadString('map_styles_light.txt');
if (!mounted) return;
if (LoadingState.of(context).isLoading!) {
LoadingState.of(context).toggleLoading();
}
}
@override
void initState() {
super.initState();
beachPlace = CameraPosition(
target: LatLng(widget.beach.latitude, widget.beach.longitude),
zoom: 14.4746,
);
beachMarker = Marker(
markerId: const MarkerId('beachMarker'),
position: LatLng(widget.beach.latitude, widget.beach.longitude),
);
WidgetsBinding.instance.addPostFrameCallback((_) async {
await setMapStyle();
images = await Api.instance.getImages(widget.beach.id);
setState(() {});
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: ThemeState.of(context, listen: true).isDark
? kColorBlueDark2.withOpacity(0.5)
: kColorGreelLight2.withOpacity(0.9),
appBar: AppBar(
backgroundColor: ThemeState.of(context, listen: true).isDark
? kColorBlueDark2.withOpacity(0.5)
: kColorGreelLight2.withOpacity(0.9),
centerTitle: true,
title: SelectableText(
widget.beach.name,
style: kStyleDefault.copyWith(
fontSize: 23.sp,
color: ThemeState.of(context, listen: true).isDark
? kColorOrangeLight
: kColorBlueDark2,
),
),
),
body: SafeArea(
child: Stack(
children: [
if (isLoading)
const Loader()
else
FadeIn(
duration: const Duration(milliseconds: 700),
child: Container(
decoration: BoxDecoration(
color: ThemeState.of(context, listen: true).isDark
? kColorBlueDark2.withOpacity(0.5)
: kColorGreelLight2.withOpacity(0.9),
),
child: SingleChildScrollView(
child: Column(
children: [
if (false)
Column(
children: [
SizedBox(
height: 25.h,
),
Text(
'${S.current.pageBeachRating} ${actualRating.toStringAsFixed(1)} / 5',
style: kStyleDefault.copyWith(
fontSize: 16.sp,
color: ThemeState.of(context, listen: true)
.isDark
? kColorOrangeLight
: kColorBlueDark2,
),
),
SizedBox(
height: 5.h,
),
Text(
' ($totalRatings ${S.current.pageBeachRatings})',
style: kStyleDefault.copyWith(
fontSize: 14.sp,
color: ThemeState.of(context, listen: true)
.isDark
? kColorOrangeLight
: kColorBlueDark2,
),
),
],
),
SizedBox(
height: 10.h,
),
if (false)
if (FirebaseAuth.instance.currentUser != null)
Padding(
padding: EdgeInsets.symmetric(horizontal: 25.0.h),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Flexible(
child: GestureDetector(
onTap: () {},
child: hasUserRated
? Text(
S.current.pageBeachRated,
style: kStyleDefault.copyWith(
fontSize: 16.sp,
color: Colors.red,
),
)
: RatingBar.builder(
initialRating: 0.5,
minRating: 0.5,
allowHalfRating: true,
itemPadding: EdgeInsets.symmetric(
horizontal: 4.0.w,
),
itemBuilder: (context, index) =>
Image.asset(
'assets/images/sea.png',
color: Colors.orange,
),
onRatingUpdate: (rating) async {
log.wtf('rated $rating');
// await Api.instance.addRating(
// Rating(
// beachId: widget.beach!.id,
// rating: rating,
// review: 'test review',
// userUid: FirebaseAuth
// .instance
// .currentUser!
// .uid,
// ),
// );
// setState(
// () {
// chosenRating = rating;
// addRating(
// Rating(
// beachId: widget.beach!.id,
// rating: rating,
// beachName:
// widget.beach!.name,
// userUid: FirebaseAuth
// .instance
// .currentUser!
// .uid,
// username: FirebaseAuth
// .instance
// .currentUser!
// .displayName,
// ),
// );
// hasUserRated = true;
// ratingSum = widget
// .beach!.averageRating! *
// widget.beach!.ratingCount!;
// actualRating =
// (ratingSum + rating) /
// (totalRatings + 1);
// totalRatings += 1;
// },
// );
},
glowColor: Colors.blue,
),
),
),
SizedBox(
width: 5.w,
),
Text(
chosenRating?.toString() ?? 'N/A',
style: kStyleDefault.copyWith(
fontSize: 25.sp,
color: Colors.orange[50],
),
)
],
),
),
SizedBox(
height: 10.h,
),
Container(
decoration: BoxDecoration(
color: ThemeState.of(context, listen: true).isDark
? kColorBlueDark2.withOpacity(0.5)
: kColorGreelLight2,
boxShadow: [kSmallShadow],
),
child: Padding(
padding: EdgeInsets.symmetric(
vertical: 10.0.h,
horizontal: 8.0.w,
),
child: SelectableText(
widget.beach.description,
style: kStyleDefault.copyWith(
height: 1.7,
color:
ThemeState.of(context, listen: true).isDark
? kColorOrangeLight
: kColorPurpleDark,
),
),
),
),
SizedBox(
width: 1.sw,
height: 250.h,
child: PageView(
controller: _imageController,
children: [
for (var i = 0; i < images.length; i++)
Padding(
padding: EdgeInsets.all(8.0.r),
child: GestureDetector(
onTap: () async {
await open(context, i);
},
child: Hero(
tag: images[i].url.toString(),
child: Container(
width: 250.w,
height: 150.h,
decoration: BoxDecoration(
boxShadow: [
kSmallShadow,
],
borderRadius:
BorderRadius.circular(8.r),
image: DecorationImage(
image: CachedNetworkImageProvider(
images[i].url.toString(),
),
fit: BoxFit.cover,
),
),
),
),
),
)
],
),
),
// Source button
TextButton(
onPressed: () {
Get.to(
() => Scaffold(
appBar: AppBar(
title: Text(
'${widget.beach.name} ${S.current.source}',
style: kStyleDefault.copyWith(
fontSize: 23.sp,
color:
ThemeState.of(context, listen: true)
.isDark
? kColorOrangeLight
: kColorBlueDark2,
),
),
backgroundColor:
ThemeState.of(context, listen: true)
.isDark
? kColorBlueDark2.withOpacity(0.5)
: kColorGreelLight2.withOpacity(0.9),
centerTitle: true,
),
),
);
},
child: Text(
S.current.source.toTitleCase!,
style: kStyleDefaultBold.copyWith(
fontSize: 25.sp,
color: ThemeState.of(context, listen: true).isDark
? kColorGreenLight
: kColorBlueDark2,
),
),
),
// Map location
SizedBox(
width: ScreenUtil().screenWidth,
height: 250.h,
child: GoogleMap(
markers: {beachMarker!},
myLocationButtonEnabled: false,
initialCameraPosition:
beachPlace, // mapController.setMapStyle(_mapStyle);
onMapCreated: (GoogleMapController controller) {
mapController = controller;
mapController.setMapStyle(_mapStyle);
_controller.complete(controller);
},
),
),
],
),
),
),
),
],
),
),
);
}
}
| 0
|
mirrored_repositories/Blue-Waves-Flutter/lib/pages
|
mirrored_repositories/Blue-Waves-Flutter/lib/pages/beach_page/beach_image_wrapper.dart
|
import 'package:blue_waves/constants.dart';
import 'package:blue_waves/models/photo.dart';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:photo_view/photo_view.dart';
import 'package:photo_view/photo_view_gallery.dart';
class GalleryPhotoViewWrapper extends StatefulWidget {
GalleryPhotoViewWrapper({
required this.images,
required this.initialIndex,
this.loadingBuilder,
this.backgroundDecoration,
this.minScale,
this.maxScale,
this.scrollDirection = Axis.horizontal,
}) : pageController = PageController(initialPage: initialIndex);
final LoadingBuilder? loadingBuilder;
final Decoration? backgroundDecoration;
final dynamic minScale;
final dynamic maxScale;
final int initialIndex;
final PageController pageController;
final List<Photo> images;
final Axis scrollDirection;
@override
State<StatefulWidget> createState() {
return _GalleryPhotoViewWrapperState();
}
}
class _GalleryPhotoViewWrapperState extends State<GalleryPhotoViewWrapper> {
late int currentIndex;
late List<String> imageUrls;
@override
void initState() {
super.initState();
currentIndex = widget.initialIndex;
imageUrls = List<String>.generate(
widget.images.length,
(index) => widget.images[index].url.toString(),
);
}
void onPageChanged(int index) {
setState(() {
currentIndex = index;
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.transparent,
body: Container(
decoration: widget.backgroundDecoration,
constraints: BoxConstraints.expand(
height: MediaQuery.of(context).size.height,
),
child: Stack(
alignment: Alignment.bottomRight,
children: <Widget>[
PhotoViewGallery.builder(
scrollPhysics: const BouncingScrollPhysics(),
builder: _buildItem,
itemCount: widget.images.length,
loadingBuilder: widget.loadingBuilder,
backgroundDecoration:
widget.backgroundDecoration as BoxDecoration?,
pageController: widget.pageController,
onPageChanged: onPageChanged,
scrollDirection: widget.scrollDirection,
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 14.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
GestureDetector(
onTap: Get.back,
child: Icon(
Icons.arrow_back_ios,
size: 40,
color: Colors.orange[50],
),
),
Flexible(
child: Container(
padding: const EdgeInsets.all(20.0),
child: Text(
'${currentIndex + 1}η φωτογραφία',
style: kStyleDefault.copyWith(
color: Colors.orange[50],
fontSize: 25.0,
),
),
),
),
],
),
)
],
),
),
);
}
PhotoViewGalleryPageOptions _buildItem(BuildContext context, int index) {
return PhotoViewGalleryPageOptions(
imageProvider: CachedNetworkImageProvider(imageUrls[index]),
initialScale: PhotoViewComputedScale.contained,
minScale: PhotoViewComputedScale.contained * (0.5 + index / 10),
maxScale: PhotoViewComputedScale.covered * 4.1,
heroAttributes: PhotoViewHeroAttributes(tag: imageUrls[index]),
);
}
}
| 0
|
mirrored_repositories/Blue-Waves-Flutter/lib/pages
|
mirrored_repositories/Blue-Waves-Flutter/lib/pages/components/snack_bar.dart
|
import 'package:blue_waves/constants.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
SnackbarController showSnack({
required String title,
required String message,
int duration = 1300,
Color firstColor = Colors.white,
Color secondColor = Colors.white,
}) {
return Get.snackbar(
'',
'',
duration: Duration(
milliseconds: duration,
),
backgroundColor: Colors.orange[50],
backgroundGradient: LinearGradient(
colors: [
firstColor,
secondColor,
],
),
titleText: Text(
title,
textAlign: TextAlign.center,
style: kStyleDefaultBold.copyWith(
color: const Color(0xff005295),
fontSize: 25.sp,
),
),
messageText: Text(
message,
textAlign: TextAlign.center,
style: kStyleDefaultBold.copyWith(
color: Colors.orange[50],
fontSize: 20.sp,
),
),
barBlur: 5,
);
}
| 0
|
mirrored_repositories/Blue-Waves-Flutter/lib/pages
|
mirrored_repositories/Blue-Waves-Flutter/lib/pages/components/loader.dart
|
import 'package:blue_waves/constants.dart';
import 'package:blue_waves/generated/l10n.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:lottie/lottie.dart';
class Loader extends StatelessWidget {
const Loader({
super.key,
});
@override
Widget build(BuildContext context) {
return ColoredBox(
color: Colors.transparent,
child: Transform.scale(
scale: 0.5,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Lottie.asset('assets/images/loading.json'),
Text(
S.current.loading,
textAlign: TextAlign.center,
style: kStyleDefaultBold.copyWith(
fontSize: 60.sp,
),
)
],
),
),
);
}
}
| 0
|
mirrored_repositories/Blue-Waves-Flutter/lib/pages/components
|
mirrored_repositories/Blue-Waves-Flutter/lib/pages/components/animated_background/animated_background.dart
|
// ignore_for_file: use_build_context_synchronously
import 'package:blue_waves/constants.dart';
import 'package:blue_waves/pages/components/animated_background/abyss.dart';
import 'package:blue_waves/pages/components/animated_background/birds_stars.dart';
import 'package:blue_waves/pages/components/animated_background/sun_moon.dart';
import 'package:blue_waves/pages/components/animated_background/title.dart';
import 'package:blue_waves/pages/components/animated_background/waves.dart';
import 'package:blue_waves/states/theme_state.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
class AnimatedBackground extends StatefulWidget {
const AnimatedBackground({
super.key,
this.showTitle,
this.showBack = false,
this.waveHeight = WaveHeight.big,
this.showBirds = true,
this.showSun = true,
});
final bool? showTitle;
final bool showBack;
final bool showSun;
final bool showBirds;
final WaveHeight waveHeight;
@override
_AnimatedBackgroundState createState() => _AnimatedBackgroundState();
}
class _AnimatedBackgroundState extends State<AnimatedBackground> {
@override
Widget build(BuildContext context) {
return Stack(
children: [
Container(
color: ThemeState.of(context, listen: true).isDark
? const Color(0xff0F044C)
: Colors.orange[100],
),
Positioned(
bottom: 0,
left: 0,
right: 0,
child: Waves(
height: widget.waveHeight,
),
),
if (widget.showTitle ?? false)
const SafeArea(
child: Align(
alignment: Alignment.topCenter,
child: BlueWavesTitle(),
),
)
else
const SizedBox(),
const Abyss(),
if (widget.showSun)
Positioned(
right: ThemeState.of(context, listen: true).isDark ? 30.w : 30.w,
child: GestureDetector(
onTap: () async {
ThemeState.of(context).toggleTheme();
},
child: SafeArea(
child: SunMoon(
isDark: ThemeState.of(context, listen: true).isDark,
),
),
),
),
if (widget.showBirds)
Positioned(
top: ThemeState.of(context, listen: true).isDark ? -15 : -45,
right: 0,
left: 0,
child: IgnorePointer(
child: BirdsStars(
isDark: ThemeState.of(context, listen: true).isDark,
),
),
),
if (widget.showBack)
Positioned(
child: GestureDetector(
onTap: () {
Get.back();
},
child: Container(
width: 50.w,
height: 40.w,
color: Colors.transparent,
child: Icon(
Icons.arrow_back,
size: 30.w,
color: ThemeState.of(context, listen: true).isDark
? kColorOrangeLight
: kColorBlueDark2,
),
),
),
),
],
);
}
}
| 0
|
mirrored_repositories/Blue-Waves-Flutter/lib/pages/components
|
mirrored_repositories/Blue-Waves-Flutter/lib/pages/components/animated_background/birds_stars.dart
|
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:lottie/lottie.dart';
class BirdsStars extends StatelessWidget {
final bool isDark;
const BirdsStars({required this.isDark});
@override
Widget build(BuildContext context) {
return AnimatedCrossFade(
duration: const Duration(milliseconds: 900),
crossFadeState:
isDark ? CrossFadeState.showSecond : CrossFadeState.showFirst,
firstCurve: Curves.easeInOut,
firstChild: SizedBox(
width: 1.sw,
height: 250.h,
child: Lottie.asset(
'assets/images/birds.json',
animate: true,
repeat: true,
width: double.infinity,
),
),
secondCurve: Curves.easeInOut,
secondChild: SizedBox(
width: double.infinity,
height: 200.h,
child: Lottie.asset(
'assets/images/stars.json',
animate: true,
repeat: true,
),
),
);
}
}
| 0
|
mirrored_repositories/Blue-Waves-Flutter/lib/pages/components
|
mirrored_repositories/Blue-Waves-Flutter/lib/pages/components/animated_background/waves.dart
|
import 'package:blue_waves/constants.dart';
import 'package:blue_waves/states/theme_state.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:wave/config.dart';
import 'package:wave/wave.dart';
enum WaveHeight {
small,
big,
}
class Waves extends StatelessWidget {
final WaveHeight height;
const Waves({required this.height});
@override
Widget build(BuildContext context) {
final themeState = ThemeState.of(context, listen: true);
return Stack(
children: [
SizedBox(
height: 660.h,
child: WaveWidget(
backgroundColor: Colors.transparent,
config: CustomConfig(
gradients: [
[
if (themeState.isDark) kColorPurpleDark else kColorGreenArmy,
if (themeState.isDark) kColorBlack else kColorGreelLight2,
],
[
if (themeState.isDark) kColorPurpleDark else kColorBlueLight,
if (themeState.isDark) kColorPurpleDark else kColorGreenArmy,
],
[
if (themeState.isDark) kColorGreenArmy else kColorWhite,
if (themeState.isDark) kColorPurpleDark else kColorBlueLight,
],
[
if (themeState.isDark) kColorGreenLight else kColorBlueLight,
if (themeState.isDark) kColorPurpleDark else kColorGreenArmy,
]
],
durations: themeState.isDark
? [35000, 40000, 45000, 55000]
: [35000, 19440, 10800, 6000],
heightPercentages: height == WaveHeight.small
? themeState.isDark
? [0.6, 0.7, 0.9, 0.7]
: [0.6, 0.7, 0.9, 0.7]
: themeState.isDark
? [0.02, 0.03, 0.04, 0.05]
: [0.01, 0.02, 0.01, 0.02],
blur: const MaskFilter.blur(
BlurStyle.inner,
14,
),
gradientBegin: Alignment.bottomLeft,
gradientEnd: Alignment.topRight,
),
waveFrequency: 0.9,
size: Size.infinite,
),
),
],
);
}
}
| 0
|
mirrored_repositories/Blue-Waves-Flutter/lib/pages/components
|
mirrored_repositories/Blue-Waves-Flutter/lib/pages/components/animated_background/title.dart
|
import 'dart:ui';
import 'package:blue_waves/constants.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class BlueWavesTitle extends StatelessWidget {
const BlueWavesTitle({this.isBlurred = false});
final bool isBlurred;
@override
Widget build(BuildContext context) {
return ClipRRect(
borderRadius: BorderRadius.circular(16.r),
child: BackdropFilter(
filter: ImageFilter.blur(
sigmaX: isBlurred ? 5 : 0,
sigmaY: isBlurred ? 5 : 0,
),
child: ColoredBox(
color: isBlurred ? Colors.black.withOpacity(0.2) : Colors.transparent,
child: Padding(
padding: EdgeInsets.symmetric(
vertical: 4.0.h,
horizontal: 14.w,
),
child: RichText(
text: TextSpan(
text: 'Blue ',
style: kStyleDefaultBold.copyWith(
fontSize: 35.sp,
color: kColorBlue,
),
children: <TextSpan>[
TextSpan(
text: 'Waves',
style: kStyleDefaultBold.copyWith(
fontSize: 35.sp,
color: kColorBlueLight2,
),
),
],
),
),
),
),
),
);
}
}
| 0
|
mirrored_repositories/Blue-Waves-Flutter/lib/pages/components
|
mirrored_repositories/Blue-Waves-Flutter/lib/pages/components/animated_background/abyss.dart
|
import 'package:blue_waves/constants.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class Abyss extends StatelessWidget {
const Abyss({
super.key,
});
@override
Widget build(BuildContext context) {
return Padding(
padding: EdgeInsets.only(top: 200.h),
child: Container(
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.bottomCenter,
end: Alignment.topCenter,
colors: [
Colors.black,
kColorBlueDark.withOpacity(0.5),
Colors.transparent,
],
),
),
),
);
}
}
| 0
|
mirrored_repositories/Blue-Waves-Flutter/lib/pages/components
|
mirrored_repositories/Blue-Waves-Flutter/lib/pages/components/animated_background/sun_moon.dart
|
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:lottie/lottie.dart';
class SunMoon extends StatelessWidget {
final bool isDark;
const SunMoon({required this.isDark});
@override
Widget build(BuildContext context) {
return AnimatedCrossFade(
duration: const Duration(milliseconds: 900),
crossFadeState:
isDark ? CrossFadeState.showFirst : CrossFadeState.showSecond,
firstCurve: Curves.easeInOut,
firstChild: Lottie.asset(
'assets/images/moon.json',
animate: true,
repeat: true,
width: 40.w,
),
secondCurve: Curves.easeInOut,
secondChild: Lottie.asset(
'assets/images/sun.json',
animate: true,
repeat: true,
width: 40.w,
),
);
}
}
| 0
|
mirrored_repositories/Blue-Waves-Flutter/lib/pages
|
mirrored_repositories/Blue-Waves-Flutter/lib/pages/register_login_page/auth_page.dart
|
import 'package:animate_do/animate_do.dart';
import 'package:blue_waves/constants.dart';
import 'package:blue_waves/generated/l10n.dart';
import 'package:blue_waves/pages/components/animated_background/animated_background.dart';
import 'package:blue_waves/pages/components/animated_background/waves.dart';
import 'package:blue_waves/pages/components/loader.dart';
import 'package:blue_waves/pages/register_login_page/components/login_container.dart';
import 'package:blue_waves/states/loading_state.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:provider/provider.dart';
class AuthPage extends StatefulWidget {
@override
_AuthPageState createState() => _AuthPageState();
}
class _AuthPageState extends State<AuthPage> {
TextEditingController emailController = TextEditingController();
TextEditingController passwordController = TextEditingController();
TextEditingController usernameController = TextEditingController();
bool registering = false;
@override
Widget build(BuildContext context) {
final auth = FirebaseAuth.instance;
final loadingState = context.watch<LoadingState>();
return Scaffold(
resizeToAvoidBottomInset: false,
body: FadeIn(
duration: const Duration(milliseconds: 700),
child: Stack(
children: [
const AnimatedBackground(
showTitle: true,
waveHeight: WaveHeight.small,
),
Login(
usernameController: usernameController,
emailController: emailController,
passwordController: passwordController,
loadingState: loadingState,
auth: auth,
registering: registering,
onRegisterTap: () {
setState(
() {
registering = !registering;
},
);
},
),
Positioned(
bottom: 45.h,
left: 50.w,
right: 50.w,
child: TextButton(
onPressed: Get.back,
child: Text(
S.current.back,
style: kStyleDefaultBold.copyWith(
fontSize: 18.sp,
color: kColorWhite.withOpacity(0.8),
),
),
),
),
// ignore: prefer_if_elements_to_conditional_expressions
loadingState.isLoading! ? const Loader() : const SizedBox(),
],
),
),
);
}
}
| 0
|
mirrored_repositories/Blue-Waves-Flutter/lib/pages/register_login_page
|
mirrored_repositories/Blue-Waves-Flutter/lib/pages/register_login_page/components/login_container.dart
|
import 'package:blue_waves/api/api_service.dart';
import 'package:blue_waves/constants.dart';
import 'package:blue_waves/generated/l10n.dart';
import 'package:blue_waves/models/member.dart';
import 'package:blue_waves/pages/components/snack_bar.dart';
import 'package:blue_waves/pages/globe_view.dart';
import 'package:blue_waves/pages/register_login_page/components/text_field.dart';
import 'package:blue_waves/states/loading_state.dart';
import 'package:blue_waves/states/theme_state.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:string_extensions/string_extensions.dart';
class Login extends StatelessWidget {
const Login({
super.key,
required this.emailController,
required this.passwordController,
required this.usernameController,
required this.loadingState,
required this.auth,
required this.onRegisterTap,
this.registering = false,
});
final TextEditingController usernameController;
final TextEditingController emailController;
final TextEditingController passwordController;
final LoadingState loadingState;
final FirebaseAuth auth;
final VoidCallback onRegisterTap;
final bool registering;
@override
Widget build(BuildContext context) {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SizedBox(
height: 10.h,
),
if (registering)
BWTextField(
controller: usernameController,
obscureText: false,
labelText: S.current.username,
),
BWTextField(
controller: emailController,
obscureText: false,
labelText: 'Email',
type: TextInputType.emailAddress,
),
BWTextField(
controller: passwordController,
type: TextInputType.emailAddress,
labelText: S.current.pass,
isPassword: true,
),
SizedBox(
height: 20.h,
),
ElevatedButton(
style: ButtonStyle(
backgroundColor: MaterialStateProperty.all(
ThemeState.of(context, listen: true).isDark
? kColorBlue
: kColorOrangeLight,
),
),
onPressed: registering
? () async {
loadingState.toggleLoading();
if (!emailController.text.isMail) {
loadingState.toggleLoading();
log.wtf('im here ${emailController.text}');
showSnack(
title: S.current.error,
message: S.current.errorMail,
firstColor: Colors.red,
secondColor: Colors.red[800]!,
duration: 2800,
);
} else {
try {
await Api.instance.registerUser(
Member(
displayName: usernameController.text,
email: emailController.text,
password: passwordController.text,
),
);
loadingState.toggleLoading();
await Get.offAll(() => GlobeView());
} on FirebaseAuthException catch (e) {
loadingState.toggleLoading();
showSnack(
title: S.current.error,
message: e.message!,
firstColor: Colors.red,
secondColor: Colors.red[800]!,
duration: 2800,
);
log.e(e);
}
}
}
: () async {
loadingState.toggleLoading();
try {
await auth.signInWithEmailAndPassword(
email: emailController.text,
password: passwordController.text,
);
loadingState.toggleLoading();
await Get.offAll(() => GlobeView());
} on FirebaseAuthException catch (e) {
loadingState.toggleLoading();
showSnack(
title: S.current.error,
message: e.message!,
firstColor: Colors.red,
secondColor: Colors.red[800]!,
duration: 2800,
);
log.e(e);
}
},
child: Text(
registering ? S.current.register : S.current.login,
style: kStyleDefaultBold.copyWith(
fontSize: 24.sp,
color: ThemeState.of(context, listen: true).isDark
? kColorOrangeLight
: kColorBlue,
),
),
),
SizedBox(
height: 10.h,
),
GestureDetector(
onTap: onRegisterTap,
child: Text(
registering ? S.current.login : S.current.register,
style: kStyleDefault.copyWith(
fontSize: 17.sp,
color: ThemeState.of(context, listen: true).isDark
? kColorOrangeLight!.withOpacity(0.6)
: kColorWhite,
),
),
),
SizedBox(
height: 10.h,
),
Row(
children: [
Flexible(
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 20.0.w),
child: Container(
height: 0.3.h,
color: kColorWhite,
),
),
),
Text(
S.current.or,
style: kStyleDefault.copyWith(
fontSize: 17.sp,
),
),
Flexible(
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 20.0.w),
child: Container(
height: 0.3.h,
color: kColorWhite,
),
),
),
],
),
SizedBox(
height: 10.h,
),
GestureDetector(
onTap: () async {
UserCredential? user;
try {
user = await googleSign();
log.wtf(user);
if (user != null) {
final isRegistered =
await Api.instance.checkUser(user.user!.email!);
if (!isRegistered) {
log.i('Google user not registered.');
await Api.instance.registerGoogleUser(
id: user.user!.uid,
displayName: user.user!.email!,
);
} else {
log.i('Google user is already registered with that email.');
Get.offAll(() => GlobeView());
}
}
} catch (e) {
log.e(e);
}
},
child: Image.asset(
'assets/images/gsign.png',
height: 50.h,
),
),
],
);
}
}
| 0
|
mirrored_repositories/Blue-Waves-Flutter/lib/pages/register_login_page
|
mirrored_repositories/Blue-Waves-Flutter/lib/pages/register_login_page/components/text_field.dart
|
import 'package:blue_waves/constants.dart';
import 'package:blue_waves/states/theme_state.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class BWTextField extends StatefulWidget {
const BWTextField({
required this.labelText,
this.controller,
this.type,
this.isPassword = false,
this.obscureText,
super.key,
});
final TextEditingController? controller;
final String labelText;
final TextInputType? type;
final bool isPassword;
final bool? obscureText;
@override
_BWTextFieldState createState() => _BWTextFieldState();
}
class _BWTextFieldState extends State<BWTextField> {
bool showingPassword = false;
@override
Widget build(BuildContext context) {
return Padding(
padding: EdgeInsets.symmetric(
vertical: 8.0.h,
horizontal: 20.w,
),
child: TextField(
cursorColor: kColorBlueLight,
autocorrect: false,
obscureText: widget.obscureText ?? !showingPassword,
controller: widget.controller,
keyboardType: widget.type,
showCursor: true,
decoration: InputDecoration(
suffixIcon: widget.isPassword
? GestureDetector(
onTap: () {
setState(() {
if (!showingPassword) {
showingPassword = true;
} else {
showingPassword = false;
}
});
},
child: showingPassword
? const Icon(Icons.visibility)
: const Icon(Icons.visibility_off),
)
: const SizedBox.shrink(),
labelText: widget.labelText,
labelStyle: kStyleDefault.copyWith(
color: ThemeState.of(context, listen: true).isDark
? kColorOrangeLight!
: kColorBlue,
fontSize: 15.sp,
),
contentPadding: EdgeInsets.symmetric(
vertical: 15.h,
horizontal: 20.w,
),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(12.r),
borderSide: BorderSide(
color: kColorOrangeLight!,
width: 1.w,
),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(12.r),
borderSide: BorderSide(
color: kColorOrangeLight2!,
width: 1.w,
),
),
),
style: kStyleDefaultBold.copyWith(
fontSize: 25.sp,
color: kColorOrangeLight,
),
),
);
}
}
| 0
|
mirrored_repositories/Blue-Waves-Flutter/lib
|
mirrored_repositories/Blue-Waves-Flutter/lib/models/Beach.dart
|
// ignore: file_names
// ignore_for_file: depend_on_referenced_packages
import 'dart:convert';
import 'package:blue_waves/constants.dart';
import 'package:google_maps_cluster_manager/google_maps_cluster_manager.dart';
// ignore: implementation_imports
import 'package:google_maps_flutter_platform_interface/src/types/location.dart';
String beachToMap(Beach data) => json.encode(data.toJson());
class Beach with ClusterItem {
Beach({
required this.latitude,
required this.description,
required this.longitude,
required this.id,
required this.name,
required this.normalizedName,
this.averageRating,
this.ratingCount,
required this.countryId,
required this.descriptionEn,
this.descriptionSource,
this.nameEn,
});
double latitude;
double longitude;
Uri? descriptionSource;
String name;
String normalizedName;
String? nameEn;
String description;
String descriptionEn;
int id;
int countryId;
int? ratingCount;
num? averageRating;
factory Beach.fromMap(Json json) => Beach(
latitude: json['latitude'],
description: json['description'],
descriptionEn: json['description_en'],
descriptionSource: Uri.tryParse(json['description_source']),
longitude: json['longitude'],
id: json['id'],
name: json['name'],
nameEn: json['name_en'],
normalizedName: json['normalized_name'],
countryId: json['country'],
averageRating: json['averageRating'] ?? 0.0,
ratingCount: json['ratingCount'] ?? 0,
);
Json toJson() => {
'latitude': latitude,
'description': description,
'description_en': descriptionEn,
'description_source': descriptionSource.toString(),
'longitude': longitude,
'countryId': countryId,
'id': id,
'name_el': name,
'name_en': nameEn,
'normalized_name': normalizedName,
'averageRating': averageRating,
'ratingCount': ratingCount,
};
@override
LatLng get location => LatLng(latitude, longitude);
}
| 0
|
mirrored_repositories/Blue-Waves-Flutter/lib
|
mirrored_repositories/Blue-Waves-Flutter/lib/models/Favorite.dart
|
import 'package:blue_waves/constants.dart';
class Favorite {
final int beachId;
final String userMail;
final String? date;
const Favorite({
required this.beachId,
required this.userMail,
this.date,
});
factory Favorite.fromJson(Json json) => Favorite(
beachId: json['beach'],
date: json['created_at'],
userMail: json['member'],
);
Json toJson() => {
"beachId": beachId,
"date": date,
"userMail": userMail,
};
}
| 0
|
mirrored_repositories/Blue-Waves-Flutter/lib
|
mirrored_repositories/Blue-Waves-Flutter/lib/models/photo.dart
|
import 'package:blue_waves/constants.dart';
class Photo {
final int id;
final int beachId;
final DateTime createdAt;
final Uri url;
const Photo({
required this.beachId,
required this.createdAt,
required this.id,
required this.url,
});
factory Photo.fromJson(Json json) => Photo(
beachId: json['beach'],
createdAt: DateTime.parse(json['created_at']),
id: json['id'],
url: Uri.parse(json['url']),
);
Json toJson() => {
"id": id,
"beachId": beachId,
"url": url,
"createdAt": createdAt,
};
}
| 0
|
mirrored_repositories/Blue-Waves-Flutter/lib
|
mirrored_repositories/Blue-Waves-Flutter/lib/models/Member.dart
|
import 'package:blue_waves/constants.dart';
class Member {
final String? id;
final String? email;
final String? password;
final String displayName;
final String? role;
final String? photoUrl;
final List<String>? favoriteBeaches;
final String? joinDate;
final int? karma;
Member({
required this.displayName,
this.email,
this.id,
this.password,
this.photoUrl,
this.favoriteBeaches,
this.joinDate,
this.role,
this.karma,
});
factory Member.fromJson(Json json) => Member(
displayName: json['username'],
id: json['id'],
joinDate: json['joinDate'],
role: json['role'],
karma: json['karma'],
);
Json toJson() => {
"id": id,
"email": email,
"displayName": displayName,
"role": role,
"photo": photoUrl,
"joinDate": joinDate,
"karma": karma,
};
}
| 0
|
mirrored_repositories/Blue-Waves-Flutter/lib
|
mirrored_repositories/Blue-Waves-Flutter/lib/models/Rating.dart
|
import 'package:blue_waves/constants.dart';
class Rating {
final int beachId;
final double rating;
final String userMail;
final String? date;
final String? review;
const Rating({
required this.beachId,
required this.rating,
required this.userMail,
this.date,
this.review,
});
factory Rating.fromJson(Json json) => Rating(
beachId: json['beach'],
date: json['created_at'],
rating: json['rating'],
userMail: json['member'],
review: json['review'],
);
Json toJson() => {
"beachId": beachId,
"date": date,
"rating": rating,
"userMail": userMail,
"review": review,
};
}
| 0
|
mirrored_repositories/Blue-Waves-Flutter/lib
|
mirrored_repositories/Blue-Waves-Flutter/lib/states/theme_state.dart
|
import 'package:blue_waves/constants.dart';
import 'package:flutter/cupertino.dart';
import 'package:provider/provider.dart';
class ThemeState extends ChangeNotifier {
static ThemeState of(BuildContext context, {bool listen = false}) {
return Provider.of<ThemeState>(context, listen: listen);
}
bool isDark;
bool get getIsDark => isDark;
void toggleTheme() {
log.wtf('Toggling theme');
isDark = !isDark;
notifyListeners();
}
ThemeState({
required this.isDark,
});
}
| 0
|
mirrored_repositories/Blue-Waves-Flutter/lib
|
mirrored_repositories/Blue-Waves-Flutter/lib/states/loading_state.dart
|
import 'package:blue_waves/constants.dart';
import 'package:flutter/cupertino.dart';
import 'package:provider/provider.dart';
class LoadingState extends ChangeNotifier {
bool? isLoading;
LoadingState({
this.isLoading,
});
static LoadingState of(BuildContext context, {bool listen = false}) {
return Provider.of<LoadingState>(context, listen: listen);
}
void getIsLoading() => isLoading;
void toggleLoading() {
log.wtf('Toggled loading');
isLoading = !isLoading!;
notifyListeners();
}
}
| 0
|
mirrored_repositories/Blue-Waves-Flutter/lib
|
mirrored_repositories/Blue-Waves-Flutter/lib/states/app_config.dart
|
import 'package:firebase_remote_config/firebase_remote_config.dart';
import 'package:package_info/package_info.dart';
class AppConfig {
factory AppConfig() {
return instance;
}
static final AppConfig instance = AppConfig._internal();
AppConfig._internal();
FirebaseRemoteConfig remoteConfig = FirebaseRemoteConfig.instance;
PackageInfo? versionInformation;
PackageInfo? get getVersionInformation => versionInformation;
String getSentryDsn() {
return remoteConfig.getString('sentry_dsn');
}
String getSupabaseKey() {
return remoteConfig.getString('supabase_key');
}
String getAdUnitId() {
return remoteConfig.getString('adunit_id');
}
String getAdmobId() {
return remoteConfig.getString('admob_id');
}
String getOneSignalId() {
return remoteConfig.getString('onesignal_id');
}
}
| 0
|
mirrored_repositories/Blue-Waves-Flutter/lib
|
mirrored_repositories/Blue-Waves-Flutter/lib/generated/l10n.dart
|
// GENERATED CODE - DO NOT MODIFY BY HAND
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'intl/messages_all.dart';
// **************************************************************************
// Generator: Flutter Intl IDE plugin
// Made by Localizely
// **************************************************************************
// ignore_for_file: non_constant_identifier_names, lines_longer_than_80_chars
// ignore_for_file: join_return_with_assignment, prefer_final_in_for_each
// ignore_for_file: avoid_redundant_argument_values, avoid_escaping_inner_quotes
class S {
S();
static S? _current;
static S get current {
assert(_current != null,
'No instance of S was loaded. Try to initialize the S delegate before accessing S.current.');
return _current!;
}
static const AppLocalizationDelegate delegate = AppLocalizationDelegate();
static Future<S> load(Locale locale) {
final name = (locale.countryCode?.isEmpty ?? false)
? locale.languageCode
: locale.toString();
final localeName = Intl.canonicalizedLocale(name);
return initializeMessages(localeName).then((_) {
Intl.defaultLocale = localeName;
final instance = S();
S._current = instance;
return instance;
});
}
static S of(BuildContext context) {
final instance = S.maybeOf(context);
assert(instance != null,
'No instance of S present in the widget tree. Did you add S.delegate in localizationsDelegates?');
return instance!;
}
static S? maybeOf(BuildContext context) {
return Localizations.of<S>(context, S);
}
/// `Ratings`
String get pageBeachRatings {
return Intl.message(
'Ratings',
name: 'pageBeachRatings',
desc: '',
args: [],
);
}
/// `Rating`
String get pageBeachRating {
return Intl.message(
'Rating',
name: 'pageBeachRating',
desc: '',
args: [],
);
}
/// `You have already rated : `
String get pageBeachRated {
return Intl.message(
'You have already rated : ',
name: 'pageBeachRated',
desc: '',
args: [],
);
}
/// `Username`
String get username {
return Intl.message(
'Username',
name: 'username',
desc: '',
args: [],
);
}
/// `Sign in`
String get login {
return Intl.message(
'Sign in',
name: 'login',
desc: '',
args: [],
);
}
/// `Register`
String get register {
return Intl.message(
'Register',
name: 'register',
desc: '',
args: [],
);
}
/// `Sign out`
String get logout {
return Intl.message(
'Sign out',
name: 'logout',
desc: '',
args: [],
);
}
/// `Confirm`
String get confirm {
return Intl.message(
'Confirm',
name: 'confirm',
desc: '',
args: [],
);
}
/// `Cancel`
String get cancel {
return Intl.message(
'Cancel',
name: 'cancel',
desc: '',
args: [],
);
}
/// `Delete`
String get delete {
return Intl.message(
'Delete',
name: 'delete',
desc: '',
args: [],
);
}
/// `Delete account`
String get deleteAccount {
return Intl.message(
'Delete account',
name: 'deleteAccount',
desc: '',
args: [],
);
}
/// `Delete your account permanently, there is no retrieve option.`
String get deleteExplain {
return Intl.message(
'Delete your account permanently, there is no retrieve option.',
name: 'deleteExplain',
desc: '',
args: [],
);
}
/// `Report`
String get report {
return Intl.message(
'Report',
name: 'report',
desc: '',
args: [],
);
}
/// `Report a problem/issue.`
String get reportText {
return Intl.message(
'Report a problem/issue.',
name: 'reportText',
desc: '',
args: [],
);
}
/// `Password`
String get pass {
return Intl.message(
'Password',
name: 'pass',
desc: '',
args: [],
);
}
/// `Version`
String get version {
return Intl.message(
'Version',
name: 'version',
desc: '',
args: [],
);
}
/// `Or`
String get or {
return Intl.message(
'Or',
name: 'or',
desc: '',
args: [],
);
}
/// `Error`
String get error {
return Intl.message(
'Error',
name: 'error',
desc: '',
args: [],
);
}
/// `Something went wrong, try again later !`
String get errorText {
return Intl.message(
'Something went wrong, try again later !',
name: 'errorText',
desc: '',
args: [],
);
}
/// `Your email is not correct`
String get errorMail {
return Intl.message(
'Your email is not correct',
name: 'errorMail',
desc: '',
args: [],
);
}
/// `Back to home`
String get back {
return Intl.message(
'Back to home',
name: 'back',
desc: '',
args: [],
);
}
/// `Points`
String get points {
return Intl.message(
'Points',
name: 'points',
desc: '',
args: [],
);
}
/// `What are points ?`
String get pointsQuestion {
return Intl.message(
'What are points ?',
name: 'pointsQuestion',
desc: '',
args: [],
);
}
/// `Everytime you contribute in any way, either by rating or adding beach information, you gain Karma points.`
String get pointsExplain {
return Intl.message(
'Everytime you contribute in any way, either by rating or adding beach information, you gain Karma points.',
name: 'pointsExplain',
desc: '',
args: [],
);
}
/// `Favorite beaches`
String get favoritedBeaches {
return Intl.message(
'Favorite beaches',
name: 'favoritedBeaches',
desc: '',
args: [],
);
}
/// `Rated beaches`
String get ratedBeaches {
return Intl.message(
'Rated beaches',
name: 'ratedBeaches',
desc: '',
args: [],
);
}
/// `Edit profile`
String get editProfile {
return Intl.message(
'Edit profile',
name: 'editProfile',
desc: '',
args: [],
);
}
/// `No internet active internet connection found`
String get noConnection {
return Intl.message(
'No internet active internet connection found',
name: 'noConnection',
desc: '',
args: [],
);
}
/// `Loading...`
String get loading {
return Intl.message(
'Loading...',
name: 'loading',
desc: '',
args: [],
);
}
/// `Menu`
String get menu {
return Intl.message(
'Menu',
name: 'menu',
desc: '',
args: [],
);
}
/// `You're currently not logged`
String get notLogged {
return Intl.message(
'You\'re currently not logged',
name: 'notLogged',
desc: '',
args: [],
);
}
/// `No description found for the beach`
String get noDescription {
return Intl.message(
'No description found for the beach',
name: 'noDescription',
desc: '',
args: [],
);
}
/// `Do you want to contribute ?`
String get contribute {
return Intl.message(
'Do you want to contribute ?',
name: 'contribute',
desc: '',
args: [],
);
}
/// `Logged in as`
String get logged_as {
return Intl.message(
'Logged in as',
name: 'logged_as',
desc: '',
args: [],
);
}
/// `source`
String get source {
return Intl.message(
'source',
name: 'source',
desc: '',
args: [],
);
}
/// `New features coming soon...`
String get coming_soon {
return Intl.message(
'New features coming soon...',
name: 'coming_soon',
desc: '',
args: [],
);
}
/// `Rating`
String get rating {
return Intl.message(
'Rating',
name: 'rating',
desc: '',
args: [],
);
}
/// `No beaches found`
String get no_beaches_found {
return Intl.message(
'No beaches found',
name: 'no_beaches_found',
desc: '',
args: [],
);
}
}
class AppLocalizationDelegate extends LocalizationsDelegate<S> {
const AppLocalizationDelegate();
List<Locale> get supportedLocales {
return const <Locale>[
Locale.fromSubtags(languageCode: 'en'),
Locale.fromSubtags(languageCode: 'el'),
];
}
@override
bool isSupported(Locale locale) => _isSupported(locale);
@override
Future<S> load(Locale locale) => S.load(locale);
@override
bool shouldReload(AppLocalizationDelegate old) => false;
bool _isSupported(Locale locale) {
for (var supportedLocale in supportedLocales) {
if (supportedLocale.languageCode == locale.languageCode) {
return true;
}
}
return false;
}
}
| 0
|
mirrored_repositories/Blue-Waves-Flutter/lib/generated
|
mirrored_repositories/Blue-Waves-Flutter/lib/generated/intl/messages_en.dart
|
// DO NOT EDIT. This is code generated via package:intl/generate_localized.dart
// This is a library that provides messages for a en locale. All the
// messages from the main program should be duplicated here with the same
// function name.
// Ignore issues from commonly used lints in this file.
// ignore_for_file:unnecessary_brace_in_string_interps, unnecessary_new
// ignore_for_file:prefer_single_quotes,comment_references, directives_ordering
// ignore_for_file:annotate_overrides,prefer_generic_function_type_aliases
// ignore_for_file:unused_import, file_names, avoid_escaping_inner_quotes
import 'package:intl/intl.dart';
import 'package:intl/message_lookup_by_library.dart';
final messages = new MessageLookup();
typedef String MessageIfAbsent(String messageStr, List<dynamic> args);
class MessageLookup extends MessageLookupByLibrary {
String get localeName => 'en';
final messages = _notInlinedMessages(_notInlinedMessages);
static Map<String, Function> _notInlinedMessages(_) => <String, Function>{
"back": MessageLookupByLibrary.simpleMessage("Back to home"),
"cancel": MessageLookupByLibrary.simpleMessage("Cancel"),
"coming_soon":
MessageLookupByLibrary.simpleMessage("New features coming soon..."),
"confirm": MessageLookupByLibrary.simpleMessage("Confirm"),
"contribute":
MessageLookupByLibrary.simpleMessage("Do you want to contribute ?"),
"delete": MessageLookupByLibrary.simpleMessage("Delete"),
"deleteAccount": MessageLookupByLibrary.simpleMessage("Delete account"),
"deleteExplain": MessageLookupByLibrary.simpleMessage(
"Delete your account permanently, there is no retrieve option."),
"editProfile": MessageLookupByLibrary.simpleMessage("Edit profile"),
"error": MessageLookupByLibrary.simpleMessage("Error"),
"errorMail":
MessageLookupByLibrary.simpleMessage("Your email is not correct"),
"errorText": MessageLookupByLibrary.simpleMessage(
"Something went wrong, try again later !"),
"favoritedBeaches":
MessageLookupByLibrary.simpleMessage("Favorite beaches"),
"loading": MessageLookupByLibrary.simpleMessage("Loading..."),
"logged_as": MessageLookupByLibrary.simpleMessage("Logged in as"),
"login": MessageLookupByLibrary.simpleMessage("Sign in"),
"logout": MessageLookupByLibrary.simpleMessage("Sign out"),
"menu": MessageLookupByLibrary.simpleMessage("Menu"),
"noConnection": MessageLookupByLibrary.simpleMessage(
"No internet active internet connection found"),
"noDescription": MessageLookupByLibrary.simpleMessage(
"No description found for the beach"),
"no_beaches_found":
MessageLookupByLibrary.simpleMessage("No beaches found"),
"notLogged": MessageLookupByLibrary.simpleMessage(
"You\'re currently not logged"),
"or": MessageLookupByLibrary.simpleMessage("Or"),
"pageBeachRated":
MessageLookupByLibrary.simpleMessage("You have already rated : "),
"pageBeachRating": MessageLookupByLibrary.simpleMessage("Rating"),
"pageBeachRatings": MessageLookupByLibrary.simpleMessage("Ratings"),
"pass": MessageLookupByLibrary.simpleMessage("Password"),
"points": MessageLookupByLibrary.simpleMessage("Points"),
"pointsExplain": MessageLookupByLibrary.simpleMessage(
"Everytime you contribute in any way, either by rating or adding beach information, you gain Karma points."),
"pointsQuestion":
MessageLookupByLibrary.simpleMessage("What are points ?"),
"ratedBeaches": MessageLookupByLibrary.simpleMessage("Rated beaches"),
"rating": MessageLookupByLibrary.simpleMessage("Rating"),
"register": MessageLookupByLibrary.simpleMessage("Register"),
"report": MessageLookupByLibrary.simpleMessage("Report"),
"reportText":
MessageLookupByLibrary.simpleMessage("Report a problem/issue."),
"source": MessageLookupByLibrary.simpleMessage("source"),
"username": MessageLookupByLibrary.simpleMessage("Username"),
"version": MessageLookupByLibrary.simpleMessage("Version")
};
}
| 0
|
mirrored_repositories/Blue-Waves-Flutter/lib/generated
|
mirrored_repositories/Blue-Waves-Flutter/lib/generated/intl/messages_el.dart
|
// DO NOT EDIT. This is code generated via package:intl/generate_localized.dart
// This is a library that provides messages for a el locale. All the
// messages from the main program should be duplicated here with the same
// function name.
// Ignore issues from commonly used lints in this file.
// ignore_for_file:unnecessary_brace_in_string_interps, unnecessary_new
// ignore_for_file:prefer_single_quotes,comment_references, directives_ordering
// ignore_for_file:annotate_overrides,prefer_generic_function_type_aliases
// ignore_for_file:unused_import, file_names, avoid_escaping_inner_quotes
import 'package:intl/intl.dart';
import 'package:intl/message_lookup_by_library.dart';
final messages = new MessageLookup();
typedef String MessageIfAbsent(String messageStr, List<dynamic> args);
class MessageLookup extends MessageLookupByLibrary {
String get localeName => 'el';
final messages = _notInlinedMessages(_notInlinedMessages);
static Map<String, Function> _notInlinedMessages(_) => <String, Function>{
"back": MessageLookupByLibrary.simpleMessage("Επιστροφή στην αρχική"),
"cancel": MessageLookupByLibrary.simpleMessage("Ακύρωση"),
"coming_soon":
MessageLookupByLibrary.simpleMessage("Νέες επιλογές σύντομα..."),
"confirm": MessageLookupByLibrary.simpleMessage("Επιβεβαίωση"),
"contribute":
MessageLookupByLibrary.simpleMessage("Θέλετε να συνεισφέρετε ;"),
"delete": MessageLookupByLibrary.simpleMessage("Διαγραφή"),
"deleteAccount":
MessageLookupByLibrary.simpleMessage("Διαγραφή λογαριασμού"),
"deleteExplain": MessageLookupByLibrary.simpleMessage(
"Διαγραφή λογαριασμού οριστικά, δεν υπάρχει δυνατότητα επαναφοράς."),
"editProfile":
MessageLookupByLibrary.simpleMessage("Επεξεργασία προφίλ"),
"error": MessageLookupByLibrary.simpleMessage("Σφάλμα"),
"errorMail":
MessageLookupByLibrary.simpleMessage("Το email δεν είναι σωστό"),
"errorText": MessageLookupByLibrary.simpleMessage(
"Κάτι πήγε στραβά, δοκιμάστε ξανά αργότερα !"),
"favoritedBeaches":
MessageLookupByLibrary.simpleMessage("Αγαπημένες παραλίες"),
"loading": MessageLookupByLibrary.simpleMessage("Φορτώνει..."),
"logged_as": MessageLookupByLibrary.simpleMessage("Συνδεμένος ως"),
"login": MessageLookupByLibrary.simpleMessage("Είσοδος"),
"logout": MessageLookupByLibrary.simpleMessage("Αποσύνδεση"),
"menu": MessageLookupByLibrary.simpleMessage("Μενού"),
"noConnection": MessageLookupByLibrary.simpleMessage(
"Δεν βρέθηκε ενεργή σύνδεση στο ίντερνετ"),
"noDescription": MessageLookupByLibrary.simpleMessage(
"Δεν βρέθηκε περιγραφή για τη παραλία"),
"no_beaches_found":
MessageLookupByLibrary.simpleMessage("Δεν βρέθηκαν παραλίες"),
"notLogged":
MessageLookupByLibrary.simpleMessage("Δεν είστε συνδεμένοι"),
"or": MessageLookupByLibrary.simpleMessage("Ή"),
"pageBeachRated":
MessageLookupByLibrary.simpleMessage("Έχεις ήδη βαθμολογήσει : "),
"pageBeachRating": MessageLookupByLibrary.simpleMessage("Βαθμολογία"),
"pageBeachRatings": MessageLookupByLibrary.simpleMessage("Βαθμολογίες"),
"pass": MessageLookupByLibrary.simpleMessage("Κωδικός"),
"points": MessageLookupByLibrary.simpleMessage("Πόντοι"),
"pointsExplain": MessageLookupByLibrary.simpleMessage(
"Κάθε φορά που συνεισφέρεις με οποιόδηποτε τρόπο, είτε με βαθμολογία είτε με κάποια προσθήκη παραλίας, κερδίζεις Karma πόντους !"),
"pointsQuestion":
MessageLookupByLibrary.simpleMessage("Τι είναι οι πόντοι ;"),
"ratedBeaches":
MessageLookupByLibrary.simpleMessage("Βαθμολογημένες παραλίες"),
"rating": MessageLookupByLibrary.simpleMessage("Βαθμολογία"),
"register": MessageLookupByLibrary.simpleMessage("Εγγραφή"),
"report": MessageLookupByLibrary.simpleMessage("Αναφορά"),
"reportText": MessageLookupByLibrary.simpleMessage(
"Αναφορά προβλήματος/ζητήματος."),
"source": MessageLookupByLibrary.simpleMessage("πηγή"),
"username": MessageLookupByLibrary.simpleMessage("Όνομα χρήστη"),
"version": MessageLookupByLibrary.simpleMessage("Έκδοση")
};
}
| 0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.