repo_id
stringlengths
21
168
file_path
stringlengths
36
210
content
stringlengths
1
9.98M
__index_level_0__
int64
0
0
mirrored_repositories/scanpay/lib
mirrored_repositories/scanpay/lib/screens/Cart.dart
import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:firebase_auth/firebase_auth.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:razorpay_flutter/razorpay_flutter.dart'; import 'package:retail/screens/PurchaseHistory.dart'; import 'package:toast/toast.dart'; class Cart extends StatefulWidget { Cart({Key key, this.title}) : super(key: key); final String title; @override _Cart createState() => _Cart(); } class _Cart extends State<Cart> { FirebaseUser user; Razorpay razorpay; int price; String phoneNumber; Future<void> getUserData() async { FirebaseUser userData = await FirebaseAuth.instance.currentUser(); setState(() { user = userData; print(userData.uid); getUsercontact(); }); } Future<void> getUsercontact() async { DocumentSnapshot cn = await Firestore.instance .collection('users') .document('${user.uid}') .get(); String number = cn.data['phoneNumber']; setState(() { phoneNumber = number; return phoneNumber; }); } Future gettotalId() async { QuerySnapshot qn = await Firestore.instance .collection('userData') .document('${user.uid}') .collection('cartData') .getDocuments(); return qn.documents.length.toString(); } Future gettotal() async { int total = 0; QuerySnapshot qn = await Firestore.instance .collection('userData') .document('${user.uid}') .collection('cartData') .getDocuments(); for (int i = 0; i < qn.documents.length; i++) { total = total + int.parse(qn.documents[i]['price']); price = total; } setState(() { price = total; return price; }); return total; } @override void initState() { super.initState(); getUserData(); gettotalId(); gettotal(); getUsercontact(); razorpay = new Razorpay(); razorpay.on(Razorpay.EVENT_PAYMENT_SUCCESS, handlerPaymentSuccess); razorpay.on(Razorpay.EVENT_PAYMENT_ERROR, handlerErrorFailure); razorpay.on(Razorpay.EVENT_EXTERNAL_WALLET, handlerExternalWallet); } @override void dispose() { super.dispose(); razorpay.clear(); } void openCheckout() { var options = { 'key': '', 'amount': price * 100, 'name': 'Acme Corp.', 'description': 'Grocery Product', 'prefill': {'contact': phoneNumber, 'email': '${user.email}'}, 'external': { 'wallet': ['paytm'] } }; try { razorpay.open(options); } catch (e) { print(e.toString()); } } void handlerPaymentSuccess(PaymentSuccessResponse response) async { print('Payment success'); Toast.show('Payment success', context); await Firestore.instance .collection('userData') .document('${user.uid}') .collection('cartData') .getDocuments() .then((querySnapshot) { querySnapshot.documents.forEach((result) { Firestore.instance .collection('userOrders') .document('${user.uid}') .collection('orders') .document() .setData(result.data); }); }); Navigator.push( context, MaterialPageRoute( builder: (BuildContext context) => PurchaseHistory())); razorpay.clear(); } void handlerErrorFailure() { print('payment Error'); Toast.show('Payment Error', context); } void handlerExternalWallet() { print('External wallet'); Toast.show('External wallet', context); } @override Widget build(BuildContext context) { return Scaffold( appBar: buildAppBar(), body: SafeArea( child: Column( children: [ StreamBuilder( stream: Firestore.instance .collection("userData") .document('${user.uid}') .collection('cartData') .snapshots(), builder: (context, snapshot) { if (snapshot.data == null) return Text( ' No Items In The Cart', style: TextStyle( fontSize: 20, fontWeight: FontWeight.bold), ); return Container( height: 510, width: 395, child: ListView.separated( itemCount: snapshot.data.documents.length, itemBuilder: (context, index) { DocumentSnapshot products = snapshot.data.documents[index]; return Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Column( children: [ SizedBox(height: 5), Container( padding: EdgeInsets.all(1.0), height: 80, width: 100, decoration: BoxDecoration( color: Color(0xFF3D82AE), borderRadius: BorderRadius.circular(16)), child: Image.network(products['img']), ), ], ), Text( products['name'], style: TextStyle( color: Colors.black, fontSize: 20, ), ), Text( "\₹ " + products['price'], style: TextStyle(fontWeight: FontWeight.bold), ), GestureDetector( child: Icon( Icons.delete, color: Colors.red, size: 40, ), onTap: () { setState(() { gettotalId(); }); Firestore.instance .collection("userData") .document('${user.uid}') .collection('cartData') .document(products['id']) .delete() .then((result) {}) .catchError((e) { print(e); }); Scaffold.of(context) .showSnackBar(new SnackBar( content: new Text( 'Deleted', style: TextStyle( color: Colors.white, fontSize: 15), textAlign: TextAlign.start, ), duration: Duration(milliseconds: 300), backgroundColor: Color(0xFF3D82AE), )); }, ) ], ); }, separatorBuilder: (BuildContext context, int index) { return SizedBox(height: 20); })); }), ], ), ), bottomNavigationBar: FutureBuilder( future: gettotalId(), builder: (context, snapshot) { return Container( margin: EdgeInsets.only(left: 35, bottom: 25), child: Column( mainAxisSize: MainAxisSize.min, children: <Widget>[ Container( margin: EdgeInsets.only(right: 10), padding: EdgeInsets.all(25), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: <Widget>[ FutureBuilder( future: gettotal(), builder: (context, price) { return Text( "Total: " + '${price.data}', style: TextStyle( fontSize: 25, fontWeight: FontWeight.w300), ); }), ], ), ), Divider( height: 1, color: Colors.grey[700], ), Container( margin: EdgeInsets.only(right: 10), padding: EdgeInsets.symmetric(vertical: 30), child: Row( children: <Widget>[ Text("Quantity", style: TextStyle( fontSize: 14, fontWeight: FontWeight.w700, )), SizedBox( width: 200, ), Text( snapshot.data != null ? snapshot.data : 'Loading', style: TextStyle( fontSize: 18, fontWeight: FontWeight.w700, )), ], ), ), GestureDetector( child: Container( margin: EdgeInsets.only(right: 25), padding: EdgeInsets.all(25), decoration: BoxDecoration( color: Colors.blue[600], borderRadius: BorderRadius.circular(15)), child: Row( mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ Text( "Pay", textAlign: TextAlign.center, style: TextStyle( fontWeight: FontWeight.w900, fontSize: 17, ), ), ], ), ), onTap: () { openCheckout(); }, ), ], ), ); })); } } AppBar buildAppBar() { return AppBar( centerTitle: true, elevation: 0, backgroundColor: Colors.blue, iconTheme: IconThemeData(color: Colors.black), title: Text( "My Orders", style: TextStyle(color: Colors.black, fontWeight: FontWeight.bold), ), ); }
0
mirrored_repositories/scanpay
mirrored_repositories/scanpay/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:retail/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/Flutter-Journey/Flutter-Projects
mirrored_repositories/Flutter-Journey/Flutter-Projects/Navigation Route/screen1.dart
import 'package:fl_cl6/navigation-route/product_scree.dart'; import 'package:fl_cl6/navigation-route/screen2.dart'; import 'package:flutter/material.dart'; import 'package:flutter/src/widgets/framework.dart'; import 'package:flutter/src/widgets/placeholder.dart'; class Screen1 extends StatelessWidget { const Screen1({super.key}); @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text('Screen 1'), ), body: Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Text('Screen 1'), ElevatedButton( onPressed: () { //Navigator.pushNamed(context, '/screen2'); Navigator.push(context, MaterialPageRoute(builder: (context) => Screen2())); }, child: Text('2 Nav Push'), ), ElevatedButton( onPressed: () { //Navigator.pushNamed(context, '/screen2'); Navigator.pushReplacement(context, MaterialPageRoute(builder: (context) => Screen2())); }, child: Text('Nav Push'), ), ElevatedButton( onPressed: () { Navigator.popUntil(context, (route) => true); }, child: Text("Pop Util")), ElevatedButton( onPressed: () { //Navigator.pushNamed(context, '/screen3'); Navigator.push(context, MaterialPageRoute(builder: (context) => Screen3())); }, child: Text('Go to Screen 3'), ), ElevatedButton( onPressed: () { //Navigator.pushNamed(context, '/screen3'); Navigator.push(context, MaterialPageRoute(builder: (context) => ProductList1())); }, child: Text('Product list'), ), ], ), ), ); } }
0
mirrored_repositories/Flutter-Journey/Flutter-Projects
mirrored_repositories/Flutter-Journey/Flutter-Projects/Navigation Route/product_scree.dart
import 'package:fl_cl6/navigation-route/screen2.dart'; import 'package:flutter/material.dart'; import 'package:flutter/src/widgets/framework.dart'; import 'package:flutter/src/widgets/placeholder.dart'; class ProductList1 extends StatelessWidget { const ProductList1({super.key}); @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text('Product List'), ), body: ListView.builder( itemCount: 5, itemBuilder: (context, index) { return ListTile( title: Text("Product $index"), subtitle: Text("This is the product number $index"), leading: CircleAvatar( child: Text("$index"), ), onTap: () { Navigator.push( context, MaterialPageRoute( builder: (context) => ProductDetails1(productionList: '$index'), )).then((value) { print(value); showAboutDialog( context: context, applicationName: value, ); }); }, ); })); } } class ProductDetails1 extends StatelessWidget { String productionList; ProductDetails1({super.key, required this.productionList}); @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text('Product Details'), ), body: SafeArea( child: Center( child: Column( children: [ Text('I am Product Details $productionList'), ElevatedButton( onPressed: () { Navigator.pop( context, 'i am from product details $productionList'); }, child: Text('Back'), ), ], ), ), )); } }
0
mirrored_repositories/Flutter-Journey/Flutter-Projects
mirrored_repositories/Flutter-Journey/Flutter-Projects/Navigation Route/screen2.dart
import 'package:fl_cl6/navigation-route/screen1.dart'; import 'package:flutter/material.dart'; import 'package:flutter/src/widgets/framework.dart'; import 'package:flutter/src/widgets/placeholder.dart'; class Screen2 extends StatelessWidget { const Screen2({super.key}); @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text('Screen 2', style: Theme.of(context).textTheme.bodyMedium), ), body: Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Text('Screen 2'), ElevatedButton( onPressed: () { Navigator.push(context, MaterialPageRoute(builder: (context) => Screen1())); }, child: Text('Go to Screen 1'), ), ElevatedButton( onPressed: () { Navigator.pushAndRemoveUntil( context, MaterialPageRoute(builder: (context) => Screen3()), (route) => false); }, child: Text('3 pushAndRemoveUntil'), ), ], ), ), ); } } class Screen3 extends StatelessWidget { const Screen3({super.key}); @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text('Screen 3', style: Theme.of(context).textTheme.bodyMedium), ), body: Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Text('Screen 3'), ElevatedButton( onPressed: () { Navigator.push(context, MaterialPageRoute(builder: (context) => Screen1())); }, child: Text('Go to Screen 1'), ), ElevatedButton( onPressed: () { Navigator.push(context, MaterialPageRoute(builder: (context) => Screen1())); }, child: Text('Go to Screen 2'), ), ElevatedButton( onPressed: () { Navigator.pop(context); }, child: Text('only POP '), ), ], ), ), ); } }
0
mirrored_repositories/Flutter-Journey/Flutter-Projects
mirrored_repositories/Flutter-Journey/Flutter-Projects/Navigation Route/main.dart
import 'package:flutter/material.dart'; import 'navigation-route/myApp.dart'; void main() { runApp(const MyApp2()); } class MyApp extends StatelessWidget { const MyApp({super.key}); // This widget is the root of your application. @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', home: ThemPlay(), themeMode: ThemeMode.dark, darkTheme: ThemeData( brightness: Brightness.dark, appBarTheme: AppBarTheme( shadowColor: Colors.black, backgroundColor: Colors.deepOrange, foregroundColor: Color.fromARGB(255, 255, 255, 255), elevation: 5, centerTitle: true, titleTextStyle: TextStyle( fontSize: 20, fontWeight: FontWeight.bold, ), ), ), theme: ThemeData( textTheme: TextTheme( // by default textTheme is follow bodyMedium bodyMedium: TextStyle( fontSize: 20, fontWeight: FontWeight.bold, ), bodySmall: TextStyle( fontSize: 15, fontWeight: FontWeight.bold, ), ), appBarTheme: AppBarTheme( shadowColor: Colors.black, backgroundColor: Colors.pink, foregroundColor: Colors.white, elevation: 5, centerTitle: true, titleTextStyle: TextStyle( fontSize: 20, fontWeight: FontWeight.bold, ), ), primaryColor: Colors.green, elevatedButtonTheme: ElevatedButtonThemeData( style: ElevatedButton.styleFrom( foregroundColor: Colors.pink, backgroundColor: Colors.yellow, side: BorderSide(color: Colors.black, width: 2), shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(20.0)), elevation: 5, ), ), textButtonTheme: TextButtonThemeData( style: TextButton.styleFrom( foregroundColor: Colors.deepOrange, backgroundColor: Color.fromARGB(255, 75, 33, 243), side: BorderSide(color: Colors.black, width: 2), shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(8.0)), elevation: 5, ), ), )); } } class ThemPlay extends StatelessWidget { ThemPlay({super.key}); @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: const Text("Theme Play"), ), body: Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Text('Hello World'), Text( 'Hello World 2 ', style: Theme.of(context).textTheme.bodySmall, ), TextButton(onPressed: () {}, child: Text('Click Me')), ElevatedButton(onPressed: () {}, child: Text('Click Me')) ], ), ), ); } } class ProductList extends StatelessWidget { ProductList({super.key}); @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: const Text("Product List"), ), body: ListView.builder( itemCount: 20, itemBuilder: (context, index) { return ListTile( title: Text("Product $index"), subtitle: Text("This is the product number $index"), leading: CircleAvatar( child: Text("$index"), ), trailing: Icon(Icons.arrow_forward_ios), onTap: () { Navigator.push( context, MaterialPageRoute( builder: (context) => ProductDetailsShowTap(productionList: '$index'), )).then((value) { print(value); }); }, ); })); } } class ProductDetailsShowTap extends StatelessWidget { final String productionList; // here productionList is required parameter , must be give it final double? price; // here price is optional parameter because we use ? mark ProductDetailsShowTap({super.key, required this.productionList, this.price}); @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: const Text("First Screen"), ), body: Center( child: Column( children: [ Text( 'Product number $productionList', style: TextStyle(fontSize: 40, fontWeight: FontWeight.bold), ), ElevatedButton( onPressed: () { Navigator.pop(context, 'my name $productionList'); }, child: Text("Back")) ], ), )); } }
0
mirrored_repositories/Flutter-Journey/Flutter-Projects
mirrored_repositories/Flutter-Journey/Flutter-Projects/Navigation Route/myApp.dart
import 'package:fl_cl6/navigation-route/screen1.dart'; import 'package:fl_cl6/navigation-route/screen2.dart'; import 'package:flutter/material.dart'; class MyApp2 extends StatelessWidget { const MyApp2({super.key}); // This widget is the root of your application. @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', home: Screen1(), themeMode: ThemeMode.dark, darkTheme: ThemeData( brightness: Brightness.dark, appBarTheme: AppBarTheme( shadowColor: Colors.black, backgroundColor: Colors.deepOrange, foregroundColor: Color.fromARGB(255, 255, 255, 255), elevation: 5, centerTitle: true, titleTextStyle: TextStyle( fontSize: 20, fontWeight: FontWeight.bold, ), ), ), theme: ThemeData( textTheme: TextTheme( // by default textTheme is follow bodyMedium bodyMedium: TextStyle( fontSize: 20, fontWeight: FontWeight.bold, ), bodySmall: TextStyle( fontSize: 15, fontWeight: FontWeight.bold, ), ), appBarTheme: AppBarTheme( shadowColor: Colors.black, backgroundColor: Colors.pink, foregroundColor: Colors.white, elevation: 5, centerTitle: true, titleTextStyle: TextStyle( fontSize: 20, fontWeight: FontWeight.bold, ), ), primaryColor: Colors.green, elevatedButtonTheme: ElevatedButtonThemeData( style: ElevatedButton.styleFrom( foregroundColor: Colors.pink, backgroundColor: Colors.yellow, side: BorderSide(color: Colors.black, width: 2), shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(20.0)), elevation: 5, ), ), textButtonTheme: TextButtonThemeData( style: TextButton.styleFrom( foregroundColor: Colors.deepOrange, backgroundColor: Color.fromARGB(255, 75, 33, 243), side: BorderSide(color: Colors.black, width: 2), shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(8.0)), elevation: 5, ), ), ), initialRoute: '/screen1', routes: { '/screen1': (context) => Screen1(), '/screen2': (context) => Screen2(), '/screen3': (context) => Screen3(), }, ); } }
0
mirrored_repositories/Flutter-Journey
mirrored_repositories/Flutter-Journey/exam/w_4.dart
/* There is a base class called Media and it has a method called play() that prints “Playing media...”. You need to create a derived class called Song that inherits from the Media class and adds an additional attribute called artist (string). The Song class should override the play() method to print the artist name along with the media play message like “Playing song by $artist...'”. In main() create one instance of Media and one of Song. Call their play() methods that print proper messages. */ class Media { void play() { print("Playing media..."); } } class Song extends Media { String artist; Song(this.artist); @override void play() { print("Playing song by $artist..."); } } void main() { Media media = Media(); media.play(); Song song = Song("Sajjad Rahman"); song.play(); }
0
mirrored_repositories/Flutter-Journey/exam/mod-5/img_text
mirrored_repositories/Flutter-Journey/exam/mod-5/img_text/lib/main.dart
import 'package:flutter/material.dart'; void main() { runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({super.key}); @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', theme: ThemeData( primarySwatch: Colors.blue, ), home: HomeScreen(), ); } } class HomeScreen extends StatelessWidget { TextStyle firstLine = TextStyle(fontSize: 22, fontWeight: FontWeight.bold, color: Colors.green); @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( centerTitle: true, title: Text( 'Profile', ), ), body: Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Icon( Icons.account_circle, size: 60, color: Colors.green, ), Text( 'Sajjad Rahman', style: TextStyle(fontSize: 22, color: Colors.green), ), Text( 'Flutter Batch 4', style: TextStyle(fontSize: 18, color: Colors.blue), ), ], ), ), ); } }
0
mirrored_repositories/Flutter-Journey/exam/mod-5/img_text
mirrored_repositories/Flutter-Journey/exam/mod-5/img_text/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:img_text/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/Flutter-Journey/Problem-Solving
mirrored_repositories/Flutter-Journey/Problem-Solving/DART/number_sum.dart
import 'dart:io'; void main() { String? nums = stdin.readLineSync(); List<String> num = nums!.split(' '); int a = int.parse(num[0]); int b = int.parse(num[1]); print(a + b); }
0
mirrored_repositories/Flutter-Journey/Problem-Solving
mirrored_repositories/Flutter-Journey/Problem-Solving/DART/vowel_check.dart
import 'dart:io'; void main() { // Write your dart code from here String str = stdin.readLineSync()!; String str_low_case = str.toLowerCase(); List<String> vowel_list = ['a', 'e', 'i', 'o', 'u']; bool find = false; for (int i = 0; i < str_low_case.length; i++) { if (vowel_list.contains(str_low_case[i])) { find = true; break; } } if (find) { print("The string contains a vowel."); } else { print("The string does not contain any vowel."); } }
0
mirrored_repositories/Flutter-Journey/Problem-Solving
mirrored_repositories/Flutter-Journey/Problem-Solving/DART/greetings.dart
import 'dart:io'; void main() { String? name = stdin.readLineSync(); print("Hello, $name! Nice to meet you."); }
0
mirrored_repositories/Flutter-Journey/Problem-Solving/DART/weeks
mirrored_repositories/Flutter-Journey/Problem-Solving/DART/weeks/p-6/left_margin.dart
import 'dart:io'; void main() { int? num = int.parse(stdin.readLineSync()!); if (num > 1000) { print(0); } else { int a = 1000 - num; int b = a ~/ 2; print(b); } }
0
mirrored_repositories/Flutter-Journey/Problem-Solving/DART/weeks
mirrored_repositories/Flutter-Journey/Problem-Solving/DART/weeks/p-6/table_center.dart
import 'dart:io'; void main() { int? num = int.parse(stdin.readLineSync()!); if (num <= 300) { print(0); } else { int a = num - 300; int b = a ~/ 2; print(b); } }
0
mirrored_repositories/Flutter-Journey/Problem-Solving/DART/weeks
mirrored_repositories/Flutter-Journey/Problem-Solving/DART/weeks/p-6/intergaped_numbergap.dart
import 'dart:io'; void main() { String? num = stdin.readLineSync()!; List<String?> numbrs = num.split(' '); int? l1 = int.parse(numbrs[0]!); int? r1 = int.parse(numbrs[1]!); int? l2 = int.parse(numbrs[2]!); int? r2 = int.parse(numbrs[3]!); for (int i = l1; i < l2; i++) { stdout.write('$i '); } for (int i = r2 + 1; i <= r1; i++) { stdout.write('$i '); } }
0
mirrored_repositories/Flutter-Journey/Problem-Solving/DART/weeks
mirrored_repositories/Flutter-Journey/Problem-Solving/DART/weeks/p-8/1.dart
import 'dart:io'; void main() { // Write your dart code from here var s = stdin.readLineSync(); List<String>? l = s?.split(" "); int a = int.parse(l![0]); int b = int.parse(l[1]); if (a >= b) { int c = 24 - (a - b); print(c); } else { int c = b - a; print(c); } }
0
mirrored_repositories/Flutter-Journey/Problem-Solving/DART/weeks
mirrored_repositories/Flutter-Journey/Problem-Solving/DART/weeks/p-5/dress.dart
import 'dart:io'; void main() { String? dressCode = stdin.readLineSync(); int? temperature = int.parse(stdin.readLineSync()!); if (dressCode == "casual" && temperature >= 15 && temperature <= 25) { print("Jeans and a light jacket."); } else if (dressCode == "festive" && temperature > 25) { print("Colorful dress and sandals."); } else { print("Wear what you're comfortable in."); } }
0
mirrored_repositories/Flutter-Journey/Problem-Solving/DART/weeks
mirrored_repositories/Flutter-Journey/Problem-Solving/DART/weeks/p-4/swap.dart
import 'dart:io'; void main() { String? nums = stdin.readLineSync(); List<String>? num = nums?.split(' '); int? a = int.parse(num![0]); int? b = int.parse(num[1]); int? aa = a; int? bb = b; int temp = a; a = b; b = temp; print('Before swapping: num1 = $aa, num2 = $bb'); print('After swapping: num1 = $a, num2 = $b'); }
0
mirrored_repositories/Flutter-Journey/Problem-Solving/DART
mirrored_repositories/Flutter-Journey/Problem-Solving/DART/pattern/2_striver.dart
// for the outer loop , count no of lines // for the inner loop , count no of columns and somehow connect to the rows // print the item // obserbe the symmetry [ optional ] import 'dart:io'; void pattern1(int n) { // *** // *** // *** for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { stdout.write("* "); } print(''); } } void pattern2(int n) { // * // ** // *** for (int i = 0; i < n; i++) { for (int j = 0; j < i; j++) { stdout.write("* "); } print(''); } } void pattern3(int n) { // 1 // 1 2 // 1 2 3 for (int i = 0; i < n + 1; i++) { for (int j = 0; j < i; j++) { stdout.write("$i "); } print(''); } } void pattern4(int n) { // 1 // 2 2 for (int i = 1; i <= n; i++) { for (int j = 1; j <= i; j++) { stdout.write("$i "); } print(''); } } void pattern5(int n) { // * * * * * // * * * * // * * * // * * // * // observation : n-row+1 for (int i = 1; i <= n; i++) { for (int j = 0; j <= n - i + 1; j++) { stdout.write("$i "); } print(''); } } void pattern6(int n) { // * // * * * // * * * * * // * * * * * * * for (int i = 1; i <= n; i++) { for (int space = 1; space <= n - i; space++) { stdout.write(" "); } for (int star = 1; star <= 2 * i - 1; star++) { stdout.write("$star "); } print(''); } /* for (int j = 1; j <= n - i; j++) { stdout.write(" "); } for (int j = 1; j <= 2 * i - 1; j++) { stdout.write("* "); } print(''); */ } void patter6_otherway(int n) { // * // * * * // * * * * * // * * * * * * * for (int i = 0; i < n; i++) { for (int space = 0; space < n - i - 1; space++) { stdout.write(" "); } for (int star = 0; star < 2 * i + 1; star++) { stdout.write("$star "); } for (int space = 0; space < n - i - 1; space++) { stdout.write(" "); } print(''); } } void pattern7(int n) { // * * * * * // * * * // * for (int i = 0; i < n; i++) { for (int space = 0; space < i; space++) { stdout.write(" "); } for (int star = 0; star < 2 * (n - i) - 1; star++) { stdout.write("$star "); } print(''); } } void pattern8(int n) { // 1 // 2 1 2 //3 2 1 2 3 // 2 1 2 // 1 for (int row = 1; row <= 2 * n; row++) { int totalCols = row > n ? 2 * n - row : row; for (int space = 0; space < n - totalCols; space++) { stdout.write(" "); } for (int col = totalCols; col >= 1; col--) { stdout.write("$col "); } for (int col = 2; col <= totalCols; col++) { stdout.write("$col "); } print(''); } } void pattern9(int n) { for (int row = 1; row <= 2 * n - 1; row++) { int starts = row; if (row > n) { starts = 2 * n - row; } for (int j = 0; j < starts; j++) { stdout.write("* "); } print(''); } } void pattern11(int n) { //1 //0 1 //1 0 1 //0 1 0 1 //1 0 1 0 1 int start = 1; for (int i = 0; i < n; i++) { if (i % 2 == 0) start = 1; else start = 0; for (int j = 0; j <= i; j++) { stdout.write("$start "); start = 1 - start; } print(''); } } void pattern12(int n) { int space_no = 2 * (n - 1); for (int row = 1; row <= n; row++) { //numbers for (int col = 1; col <= row; col++) { stdout.write("$col"); } //spaces for (int space = 1; space <= space_no; space++) { stdout.write(" "); } //numbers for (int col = row; col >= 1; col--) { stdout.write("$col"); } print(''); space_no -= 2; } } void pattern17(int n) { for (int row = 0; row < n; row++) { for (int col = 0; col < n - row - 1; col++) { stdout.write(" "); } double break_point = ((2 * row + 1) / 2); int point = break_point.toInt(); int aschi_ch = 65; for (int ch = 1; ch <= 2 * row + 1; ch++) { stdout.write("${aschi_ch} "); if (ch <= point) { aschi_ch++; } else { aschi_ch--; } } for (int col = 0; col < n - row - 1; col++) { stdout.write(" "); } print(''); } } void main() { pattern17(5); pattern8(5); }
0
mirrored_repositories/Flutter-Journey/Problem-Solving/DART
mirrored_repositories/Flutter-Journey/Problem-Solving/DART/pattern/1.dart
import "dart:io"; import 'dart:math'; void main() { //pattern17(10); pattern312(3); //pattern30(5); // pattern2(4); // pattern1(4); } void pattern312(int n) { /* 4 4 4 4 4 4 4 4 3 3 3 3 3 4 4 3 2 2 2 3 4 4 3 2 1 2 3 4 4 3 2 2 2 3 4 4 3 3 3 3 3 4 4 4 4 4 4 4 4 */ n = n * 2; int originalN = n; for (int row = 0; row <= n; row++) { for (int col = 0; col <= n; col++) { int atEveryIndex = originalN - 2 - min(min(row, col), min(n - row, n - col)); stdout.write("$atEveryIndex "); } print(' '); } } void pattern311(int n) { /* 0 0 0 0 0 0 2 2 2 0 0 2 1 2 0 0 2 2 2 0 0 0 0 0 0 */ n = n * 2; for (int row = 0; row <= n; row++) { for (int col = 0; col <= n; col++) { int atEveryIndex = min(min(row, col), min(n - row, n - col)); stdout.write("$atEveryIndex "); } print(' '); } } void pattern17(int n) { // 4 3 2 1 2 3 4 // 3 2 1 2 3 // 2 1 2 // 1 for (int row = 1; row <= 2 * n; row++) { int totalColumNo = row > n ? 2 * n - row : row; int totalSpcae = n - row; for (int k = 0; k < n - totalColumNo; k++) { stdout.write(" "); } for (int col = totalColumNo; col >= 1; col--) { stdout.write('$col' + " "); } for (int col = 2; col <= totalColumNo; col++) { stdout.write("$col "); } print(' '); } } void pattern30(int n) { for (int row = 1; row <= n; row++) { int totalSpcae = n - row; for (int k = 0; k < n - row; k++) { stdout.write(" "); } for (int col = row; col >= 1; col--) { stdout.write('$col' + " "); } for (int col = 2; col <= row; col++) stdout.write("$col "); print(' '); } } void pattern28(int n) { for (int row = 0; row < 2 * n; row++) { int totalColumNo = row > n ? 2 * n - row : row; int totalSpcae = n - totalColumNo; for (int k = 0; k < totalSpcae; k++) { stdout.write(' '); } for (int col = 0; col < totalColumNo; col++) { stdout.write("* "); } print(' '); } } void pattern4(int n) { for (int row = 0; row < 2 * n; row++) { int totalColumNo = row > n ? 2 * n - row : row; for (int col = 0; col < totalColumNo; col++) { stdout.write("* "); } print(' '); } } void pattern3(int n) { //**** //*** //** //* // we can write this pattern in two ways /* for (int col = n; col >= row; col--) { stdout.write("* "); } */ for (int row = 1; row <= n; row++) { for (int col = 1; col <= n - row + 1; col++) { stdout.write("* "); } print("\n"); } } void pattern2(int n) { // **** // **** // **** for (int row = 1; row <= n; row++) { for (int col = 1; col <= n; col++) { stdout.write("* "); } print("\n"); } } void pattern1(int n) { // * // ** // *** // **** for (int i = 0; i < n; i++) { for (int j = 0; j <= i; j++) { stdout.write("* "); } print("\n"); } }
0
mirrored_repositories/Flutter-Journey/Tasks/task-05/simple_text
mirrored_repositories/Flutter-Journey/Tasks/task-05/simple_text/lib/main.dart
import 'package:flutter/material.dart'; void main() { runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({super.key}); @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', theme: ThemeData( primarySwatch: Colors.blue, ), home: HomeScreen(), ); } } class HomeScreen extends StatelessWidget { TextStyle firstLine = TextStyle( fontSize: 20, fontWeight: FontWeight.bold, ); @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( backgroundColor: Colors.green, elevation: 70, toolbarHeight: 100, centerTitle: true, title: Text( 'Home', style: TextStyle(), ), leading: Icon( Icons.image, ), actions: [ Icon(Icons.search), Padding(padding: EdgeInsets.only(right: 20)) ], ), body: Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Text( 'This is mod 5 Assignment', style: firstLine, ), SizedBox( height: 20, ), RichText( text: TextSpan( text: 'My', style: TextStyle(fontSize: 24, color: Colors.red), children: [ TextSpan( text: ' phone', style: TextStyle(color: Colors.cyan, fontSize: 16)), TextSpan( text: ' name', style: TextStyle(color: Colors.purple, fontSize: 20)), TextSpan( text: ' Vivo Y20', style: TextStyle(color: Colors.amber)), ])) ], ), ), ); } }
0
mirrored_repositories/Flutter-Journey/Tasks/task-05/simple_text
mirrored_repositories/Flutter-Journey/Tasks/task-05/simple_text/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:simple_text/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/Flutter-Journey/Tasks
mirrored_repositories/Flutter-Journey/Tasks/task-03/cars.dart
class Car { String brand; String model; int year; double milesDriven; static int numberOfCars = 0; Car(this.brand, this.model, this.year, this.milesDriven) { numberOfCars++; } void drive(double miles) { milesDriven += miles; } double getMilesDriven() { return milesDriven; } String getBrand() { return brand; } String getModel() { return model; } int getYear() { return year; } int getAge() { return 2023 - year; } }
0
mirrored_repositories/Flutter-Journey/Tasks
mirrored_repositories/Flutter-Journey/Tasks/task-03/main.dart
import 'cars.dart'; void main() { Car car1 = Car("Toyota", "Camry", 2020, 10000); Car car2 = Car("Honda", "Civic", 2018, 8000); Car car3 = Car("Ford", "F-150", 2015, 15000); print( "Car 1: ${car1.getBrand()} ${car1.getModel()} ${car1.getYear()} Miles: ${car1.getMilesDriven()} Age: ${car1.getAge()}"); print( "Car 2: ${car2.getBrand()} ${car2.getModel()} ${car2.getYear()} Miles: ${car2.getMilesDriven()} Age: ${car2.getAge()}"); print( "Car 3: ${car3.getBrand()} ${car3.getModel()} ${car3.getYear()} Miles: ${car3.getMilesDriven()} Age: ${car3.getAge()}"); print('Total number of cars created: ${Car.numberOfCars}'); }
0
mirrored_repositories/Flutter-Journey/Tasks
mirrored_repositories/Flutter-Journey/Tasks/task-04/currentAccount.dart
import 'accounts.dart'; class CurrentAccount extends Account { double overdraftLimit; CurrentAccount(int accountNumber, double balance, this.overdraftLimit) : super(accountNumber, balance); @override void withdraw(double amount) { if (amount <= overdraftLimit) { balance -= amount; print("After withdrawal: $balance"); } else { print('insufficient funds'); } } }
0
mirrored_repositories/Flutter-Journey/Tasks
mirrored_repositories/Flutter-Journey/Tasks/task-04/savaingAccount.dart
import 'accounts.dart'; class SavingsAccount extends Account { double interestRate; SavingsAccount(int accountNumber, double balance, this.interestRate) : super(accountNumber, balance); @override void withdraw(double amount) { if (amount <= balance) { balance = balance - amount; balance += balance * interestRate; print("After withdrawal: $balance"); } else { print('insufficient balance for withdrawal'); } } }
0
mirrored_repositories/Flutter-Journey/Tasks
mirrored_repositories/Flutter-Journey/Tasks/task-04/main.dart
import 'currentAccount.dart'; import 'savaingAccount.dart'; void main() { SavingsAccount savingsAccount = SavingsAccount(554505, 20200.50, 0.12); print("Initial balance: ${savingsAccount.balance}"); savingsAccount.deposit(3300); print("After deposit: ${savingsAccount.balance}"); savingsAccount.withdraw(1500); print(''); CurrentAccount currentAccount = CurrentAccount(554506, 5000.500, 10000); print("Initial balance: ${currentAccount.balance}"); currentAccount.deposit(1000); print("After deposit: ${currentAccount.balance}"); currentAccount.withdraw(1500000); }
0
mirrored_repositories/Flutter-Journey/Tasks
mirrored_repositories/Flutter-Journey/Tasks/task-04/accounts.dart
abstract class Account { int accountNumber; double balance; Account(this.accountNumber, this.balance); void deposit(double amount) { balance = balance + amount; } void withdraw(double amount); }
0
mirrored_repositories/Flutter-Journey/Tasks
mirrored_repositories/Flutter-Journey/Tasks/task-01/task_01_sajjad.dart
void main() { const int a = 7; const int b = 3; int addition = a + b; int subtraction = a - b; int multiplication = a * b; double division = a / b; int modulus = a % b; print('a = $a, b = $b'); print('Addition: $a + $b = $addition'); print('Subtraction: $a - $b = $subtraction'); print('Multiplication: $a * $b = $multiplication'); print('Division: $a / $b = $division'); print('Modulus: $a % $b = $modulus'); }
0
mirrored_repositories/Flutter-Journey/Tasks
mirrored_repositories/Flutter-Journey/Tasks/task-02/dd.dart
class Person { String name; int age; String address; Person(this.name, this.age, this.address); void sayHello() { print("Hello, my name is $name."); } int getAgeInMonths() { return age * 12; } } void main() { String name = "Ostad"; // assign your name int age = 25; //assign your age String address = "Baridhara, Dhaka"; //assign any address Person person = Person(name, age, address); person.sayHello(); int ageInMonths = person.getAgeInMonths(); print("Age in months: $ageInMonths"); }
0
mirrored_repositories/Flutter-Journey/Tasks
mirrored_repositories/Flutter-Journey/Tasks/task-02/task_02.dart
void main() { List<int> subjects = [70, 90, 78, 99, 65, 99, 84, 88, 87, 94, 91]; int total_marks = 0; for (int i = 0; i < subjects.length; i++) { total_marks += subjects[i]; } double averageMarks = total_marks / subjects.length; double decimal_Average = double.parse(averageMarks.toStringAsFixed(1)); int roundValue = averageMarks.round(); print("Student's average grade: $decimal_Average"); print("Rounded average: $roundValue"); if (averageMarks >= 70) print("Passed"); else print("Failed"); }
0
mirrored_repositories/Flutter-Journey/Dart Language/code
mirrored_repositories/Flutter-Journey/Dart Language/code/1-basic dart/data_types.dart
import 'dart:io'; void main() { print("Enter your name?"); // Reading name String? name = stdin.readLineSync(); // Printing the name print("Hello, $name! \nWelcome to dart dev !!"); }
0
mirrored_repositories/Flutter-Journey/Dart Language/code
mirrored_repositories/Flutter-Journey/Dart Language/code/1-basic dart/variables.dart
void main() { //************************* Data Type ************** /// Numeric -> integer(1,2,3,) : Floating /// - floating (1.2,3.3) /// /// Textual /// - String /// /// Boolean /// True and Flase /// String rocker = ''' samiha abdullah bristti and rimu and ava '''; String name = 'Rahim'; print('$rocker it is friends group '); print(name); /// name convention : camelCase , snack_case , PascaleCase /// /// /// /// no float type in Dart . we can use Double instead of it /// /// double cgpa = 3.84; print('cgpa is $cgpa'); String firstName = 'md'; String lastName = 'rahman'; /// string Interpolation String full_name = firstName + lastName; print('Full name is $full_name'); }
0
mirrored_repositories/Flutter-Journey/Dart Language/code
mirrored_repositories/Flutter-Journey/Dart Language/code/1-basic dart/hello_world.dart
void main() { 'sajjad'; // nothing show in console print('sajjad never stop learn'); /// basic arithmetic operators print(545+45); print(545-45); print(545/45); print(545*45); /// modulus print(34%3); }
0
mirrored_repositories/Flutter-Journey/Dart Language/code
mirrored_repositories/Flutter-Journey/Dart Language/code/5-operators/op_1.dart
void main() { int x = 20; print(x++); int y = 25; print(++y); int z = 30; print(--z); int w = 35; print(w--); int div = 10 ~/ 3; //~/ operator is used for integer division print(div); double div2 = 10 / 3; print(div2); }
0
mirrored_repositories/Flutter-Journey/Dart Language/code
mirrored_repositories/Flutter-Journey/Dart Language/code/5-operators/op_2_if-else.dart
void main() { int x = 20; if (x > 10) { print("x is greater than 10"); } else { print("x is less than or equal to 10"); } int num = 100; if (num % 2 == 0) { print('Even Number'); } else { print('Odd Number'); } }
0
mirrored_repositories/Flutter-Journey/Dart Language/code
mirrored_repositories/Flutter-Journey/Dart Language/code/9-functions/1_fun.dart
void main() { welcome(); } welcome() { print("Welcome to Dart Programming"); }
0
mirrored_repositories/Flutter-Journey/Dart Language/code
mirrored_repositories/Flutter-Journey/Dart Language/code/2-list operations/list_6_double.dart
void main() { List<int> list = [1, 2, 3, 4, 5]; print(list); list.remove(3); print(list); list.removeAt(2); print(list); list.removeLast(); print(list); list.removeRange(1, 3); print(list); list.removeWhere((element) => element == 1); }
0
mirrored_repositories/Flutter-Journey/Dart Language/code
mirrored_repositories/Flutter-Journey/Dart Language/code/2-list operations/list_5_maps.dart
void main() { List<Map<String, int>> grades = [ {'Ayo': 60, 'Samuel': 89, 'Vic': 70, 'ayo': 80}, // Two keys in a map literal shouldn't be equal. ]; int sum = 0; grades.forEach((studentGrades) { print(studentGrades); studentGrades.forEach((name, marks) { sum += marks; }); }); print('The sum of all grades is $sum'); }
0
mirrored_repositories/Flutter-Journey/Dart Language/code
mirrored_repositories/Flutter-Journey/Dart Language/code/2-list operations/list_1.dart
void main() { /// list create List<String> list = ['a', 'b', 'c']; /// list of students List<String> students = ['ali', 'ahmed', 'mohamed', 'sakib', 'sara']; print(students); // print('first element of the list is = ${students[0]}' ); students.add('sara1'); print(students); students.addAll(['sara2', 'sara2', 'sara2', 'sara2', 'sara3', 'sara4']); print(students); // now remove element from list // ----------------------------- remove sara1 -------------------- students.remove('sara1'); print('remove sara1 = $students'); // remove all data //students.clear(); // print(students); }
0
mirrored_repositories/Flutter-Journey/Dart Language/code
mirrored_repositories/Flutter-Journey/Dart Language/code/2-list operations/list_3_remove.dart
void main() { /// list of students List<String> students = ['ali', 'ahmed', 'mohamed', 'sakib', 'sara']; print(students); students.addAll(['sara2', 'sara2', 'sara2', 'sara2', 'sara3', 'sara4']); // Checking if the list contains a certain element bool containsSeven = students.contains('sakib'); print('contain sakib = $containsSeven'); // now remove element from list // ----------------------------- remove sara1 -------------------- students.remove('sara1'); print('remove sara1 = $students'); // remove all data /// - - - - - - - - if we use the clear functions in the list it removes all of the data in the list //students.clear(); // print(students); }
0
mirrored_repositories/Flutter-Journey/Dart Language/code
mirrored_repositories/Flutter-Journey/Dart Language/code/2-list operations/list_4_foreach.dart
void main() { List<String> students = ['ali', 'ahmed', 'mohamed', 'sakib', 'sara']; // Iterating through the list using forEach students.forEach((student) => print(student)); }
0
mirrored_repositories/Flutter-Journey/Dart Language/code
mirrored_repositories/Flutter-Journey/Dart Language/code/2-list operations/list_removes.dart
void main() { List<String> students = ['ali', 'ahmed', 'sakib', 'sara']; // students.removeLast(); // print(students); // [ali, ahmed, mohamed, sakib] // print(students.removeAt(2)); // mohamed print(students.remove('d')); // true print(students.reversed); // [ali, ahmed, sakib, sara] print(students.first); // ali print(students.last); // sara List<List<int>> matrix = [ [1, 2, 3], [4, 5, 6] ]; print(matrix[0][1]); // 2 print(matrix[1][2]); // 6 List<List<String>> names = [ ['ali', 'ahmed', 'sakib', 'sara'], ['mohamed', 'ahmed', 'sakib', 'sara'], ]; print(names[0][1]); // ahmed // foreach loop names.forEach((name1) { print('name1: $name1'); name1.forEach((name2) { print('single name = $name2'); }); }); }
0
mirrored_repositories/Flutter-Journey/Dart Language/code
mirrored_repositories/Flutter-Journey/Dart Language/code/2-list operations/list_2_add.dart
void main() { /// list create List<String> list = ['a', 'b', 'c']; /// list of students List<String> students = ['ali', 'ahmed', 'mohamed', 'sakib', 'sara']; print(students); // print('first element of the list is = ${students[0]}' ); students.add('sara1'); print(students); students.addAll(['sara2', 'sara2', 'sara2', 'sara2', 'sara3', 'sara4']); print(students); /// tow list add List<int> a = [1, 2, 3, 4, 5]; List<int> b = [6, 7, 8, 9, 10]; List<int> c = a + b; print(c); print("\n\t* * * * * * * * * * * * * * * * * \n"); List<int> nums = [2, 3, 4, 5]; List<int> nums2 = [6, 7, 8, 9, 10]; }
0
mirrored_repositories/Flutter-Journey/Dart Language/code
mirrored_repositories/Flutter-Journey/Dart Language/code/12-Abstraction/abstraction.dart
abstract class Person { void moving(); } abstract class Sleepable { void sleep(); } abstract class Ediable { void eat(); } class Employee extends Person implements Sleepable, Ediable { @override void moving() { print(" moving by car"); } @override void eat() { // TODO: implement eat } @override void sleep() { // TODO: implement sleep } } class Manager extends Person { @override void moving() { // TODO: implement moving } } abstract class Ceo extends Person { double sallary(); } class newManager extends Ceo { @override double sallary() { return 1000; } @override void moving() { print('hi ti nai'); } } void main() { Employee emp = new Employee(); emp.moving(); Manager mgr = new Manager(); mgr.moving(); Person p = new newManager(); p.moving(); } /// here abstract class Person is created and it has a method moving() which is abstract /// so we can't create object of Person class /// we have to create a class which extends Person class and override the moving() method /// and then we can create object of that class /// /// abstract means the behaviour of the class is not defined and we have to define it in the child class /// /// abstract class can have abstract methods and non abstract methods /// ///
0
mirrored_repositories/Flutter-Journey/Dart Language/code
mirrored_repositories/Flutter-Journey/Dart Language/code/13-Exception/exception.dart
// Exception Falut // Handle / exception handeling // Run time error is error that occures during run time . run time error is also called logical error // Compile time error is error that occures during compile time . compile time error is also called syntax error import 'dart:async'; void main() { try { dynamic a = 12 / 0; int b = a + 23; print(b); print('hello'); //throw YooException('this is my custom exception'); } on YooException { print('Yoo Exception is occured'); } on TimeoutException { print('print time out exception'); } on FormatException { print('print format exception'); } catch (e) { print(e); } finally { print('this is finally block'); } print('hello i am after exception handeling'); /// if we do not use the try and catch we can not reach the line no 16 /// because the program will be stoped at line no 12 } class YooException implements Exception { String message = "This is my custom exception"; YooException(this.message); @override String toString() { return message; } } /// clean coder /// uncel bob er code book
0
mirrored_repositories/Flutter-Journey/Dart Language/code
mirrored_repositories/Flutter-Journey/Dart Language/code/11-Encapsulation-Inheritance/inherit_ance.dart
class Human { void eating() { print("Human is eating"); } void moving() { print("Human is moving"); } void breathing() { print("Human is breathing"); } } class Teacher extends Human { void teaching() { print("Teacher is teaching"); } } class Student extends Human { void studying() { print("Student is studying"); } } class Programmer extends Student { void coding() { print("Programmer is coding"); } } class SpecailOne extends Programmer { void coding() { print("Programmer is not only coding"); } } void main() { var programmer = Programmer(); programmer.eating(); programmer.moving(); programmer.breathing(); programmer.studying(); programmer.coding(); } /// here nice thing is that /// Programmer class can access all the methods of Human class /// Programmer class can access all the methods of Student class /// In the programmer class we see only one method but it access additional 4 methods from Human and Student class /// This is called inheritance /// Inheritance is a mechanism in which one object acquires all the properties and behaviors of its parent object automatically. /// Inheritance is an important pillar of OOP(Object Oriented Programming).
0
mirrored_repositories/Flutter-Journey/Dart Language/code
mirrored_repositories/Flutter-Journey/Dart Language/code/11-Encapsulation-Inheritance/mian.dart
import 'encap_1.dart'; void main() { BankAccount account1 = new BankAccount("123-456-789", "sajjad"); print(account1.balance); print(' current tax amount ${account1.tax}'); }
0
mirrored_repositories/Flutter-Journey/Dart Language/code
mirrored_repositories/Flutter-Journey/Dart Language/code/11-Encapsulation-Inheritance/encap_1.dart
class BankAccount { String accountNo; String accountName; double _balance = 34020.0; // private variable access off BankAccount(this.accountNo, this.accountName); /// read | get /// /* double getBalance() { return _balance; } */ /// write | set /* void setBalance(double amount) { if (amount < 0) { return; } _balance = amount; } */ double get balance => _balance; void set setNewBalance(double amount) { if (amount < 0) { return; } _balance = amount; } double _calculateTax() { return (_balance / 100) * 10; } double get tax => _calculateTax(); // read only } // void main() { // BankAccount account1 = new BankAccount("123-456-789", "sajjad"); // print(account1._balance); // } /// Encapsulation is the way to hidign data from outside world and only expose the data that is required /// Encapsulation is the way to protect the data from outside world /// Encapsulation is the way to protect the data from being modified by outside world /// Encapsulation is the way to protect the data from being accessed by outside world
0
mirrored_repositories/Flutter-Journey/Dart Language/code
mirrored_repositories/Flutter-Journey/Dart Language/code/10-oop/oop_1_class.dart
class Person { String? name; int? age; double? height; Person() { name = ''; age = 0; height = 0.0; } } class Person1 { String name = 'sam'; int age = 20; double height = 2.2; Person() { name = ''; age = 0; height = 0.0; } } class Person3 { late String name; late int age; late double height; // Person3(String name, int age, double height) { // this.name = name; // this.age = age; // this.height = height; // } Person3(this.name, this.age, this.height); } // void greetPerson(String name, [int age, String occupation]) { // } void main() {} //calss - new data type / custome data // variable - data container ( object / instance) //class function - method // same name to class - Constructor
0
mirrored_repositories/Flutter-Journey/Dart Language/code
mirrored_repositories/Flutter-Journey/Dart Language/code/3-set operations/set_01_decleare.dart
void main() { Set<int> numbers = {1, 2, 3}; numbers.forEach((number) { print(number); }); }
0
mirrored_repositories/Flutter-Journey/Dart Language/code
mirrored_repositories/Flutter-Journey/Dart Language/code/6-parsing/parse.dart
void main() { int a = 12; double b = 12.5; String c = a.toString(); // int to string /// we can write in this way also '$a' or '${a}' /// /// string to int int d = int.parse(c); /// string to double double e = double.parse(c); /// int to double double f = a.toDouble(); /// double to int int g = b.toInt(); print(f.toStringAsFixed(5)); /// 12.00000 (5 digits after decimal point) /// double to boolean /// bool h = b.isNegative; bool i = b.isFinite; bool k = g.isNaN; print(h); print('isFinite: $i'); print('isNan: $k'); }
0
mirrored_repositories/Flutter-Journey/Dart Language/code
mirrored_repositories/Flutter-Journey/Dart Language/code/4-map/map_01_create.dart
void main() { Map<int, String> map = {1: 'ali', 2: 'ahmed', 3: 'sakib'}; // print(map); // {1: ali, 2: ahmed, 3: sakib} // print(map[1]); // ali // print(map['ali']); // null Map<String, dynamic> persons = { 'PersonID': 1, 'Name': 'Sajjad', 'Age': 24, 'Salary': 10000000, 'Gender': 'Male' }; print(persons['Salary']); }
0
mirrored_repositories/Flutter-Journey/Dart Language/code
mirrored_repositories/Flutter-Journey/Dart Language/code/self-learn/prectice.dart
void main() { // print('Hello VS Code! Hello Dart!'); String firstName = 'sajjad'; String lastName = 'hossain'; print(firstName + ' ' + lastName); print(firstName.runtimeType); print('my firstname is $firstName and lastname is $lastName'); }
0
mirrored_repositories/Flutter-Journey/Dart Language/code/self-learn/pre-rec
mirrored_repositories/Flutter-Journey/Dart Language/code/self-learn/pre-rec/mod-2/set_tata.dart
void main() { var cityNames = {'Kolkata', 'Mumbai', 'Delhi', 'Chennai', 'Bangalore', 100}; // if i used nothinh and the variable name is Var than it will be a OBJECT type /// /// if i set the variable name as String than it will be a STRING type i can not assign 100 var nums = <int>{1, 2, 3, 4, 5, 6}; var trueOrFalse = <bool>{true, false}; cityNames.add('Hyderabad'); cityNames.addAll({'Pune', 'Kochi', 'Jaipur'}); print(cityNames); /// print a single city name with help of elementAt() method of Set where inside a index /// /// index start from 0 /// var singleCity = cityNames.elementAt(2); print(singleCity); /// set properties /// print("\t\t- - - - set properties - - - - \n"); print(cityNames.runtimeType); // print the type of the set print(cityNames.first); // check the set is a set or not print(cityNames.last); print(cityNames.length); print(cityNames.isEmpty); print(cityNames.isNotEmpty); print(cityNames.hashCode); }
0
mirrored_repositories/Flutter-Journey/Dart Language/code/self-learn/pre-rec
mirrored_repositories/Flutter-Journey/Dart Language/code/self-learn/pre-rec/mod-2/map_tata.dart
void main() { var myMaps = {'name': 'sajjad', 'age': 24, 'city': 'Sylhet'}; /// add a new key and value in the map myMaps['country'] = 'Bangladesh'; print(myMaps); /// map create using Constructor /// var tataMap = new Map(); tataMap['name'] = 'Sajjad'; tataMap['age'] = 24; tataMap['city'] = 'Sylhet'; tataMap['country'] = 'Bangladesh'; tataMap['phone'] = '01700000001'; print(tataMap); /// map properties /// print("\t\t- - - - map properties - - - - \n"); print(tataMap.keys); print(tataMap.values); print(tataMap.length); print(tataMap.isEmpty); print(tataMap.isNotEmpty); //print(tataMap.containsKey('name')); tataMap.addAll({'email': '[email protected]', 'rl': 'none'}); print(tataMap); /// we can add other map in a map using addAll() method /// /// here is the example var otherMpa = {'sex': 'male', 'religion': 'islam'}; tataMap.addAll(otherMpa); print(tataMap); }
0
mirrored_repositories/Flutter-Journey/Dart Language/code/self-learn/pre-rec
mirrored_repositories/Flutter-Journey/Dart Language/code/self-learn/pre-rec/mod-2/switch_.dart
void main() { var marks = 78; switch (marks) { case 80: print("Excellent"); break; case 70: print("Very Good"); break; case 60: print("Good"); break; default: print("Failed"); } }
0
mirrored_repositories/Flutter-Journey/Dart Language/code/self-learn/pre-rec
mirrored_repositories/Flutter-Journey/Dart Language/code/self-learn/pre-rec/mod-2/functions_.dart
int add2num(int a, int b) { return a + b; } void main() { var a = 10; var b = 20; var sum = add2num(a, b); print("Sum of $a and $b is $sum"); }
0
mirrored_repositories/Flutter-Journey/Dart Language/code/self-learn/pre-rec
mirrored_repositories/Flutter-Journey/Dart Language/code/self-learn/pre-rec/mod-3/oop_1.dart
class MyClass { var name = "sajjad"; var aphabet = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"]; addToNumber(int number) { print(number + 1); } } void main() { var obj = MyClass(); obj.addToNumber(12); print(obj.aphabet[0]); }
0
mirrored_repositories/Flutter-Journey/Dart Language/code/self-learn/pre-rec
mirrored_repositories/Flutter-Journey/Dart Language/code/self-learn/pre-rec/mod-3/oop_2.dart
import 'myClass.dart'; void main() { var obj = MyClass2(); print(obj.name); print(obj.aphabet); }
0
mirrored_repositories/Flutter-Journey/Dart Language/code/self-learn/pre-rec
mirrored_repositories/Flutter-Journey/Dart Language/code/self-learn/pre-rec/mod-3/myClass.dart
class MyClass2 { var name = "sajjad"; var aphabet = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"]; addTwoNumber(int num1, int num2) { print(num1 + num2); } multiplication(int num1, int num2) { print(num1 * num2); } }
0
mirrored_repositories/Flutter-Journey/Dart Language/code/self-learn/pre-rec
mirrored_repositories/Flutter-Journey/Dart Language/code/self-learn/pre-rec/oop/mordgate.dart
class Calculator { double add(double a, double b) { return a + b; } double subtract(double a, double b) { return a - b; } double multiply(double a, double b) { return a * b; } double divide(double a, double b) { if (b != 0) { return a / b; } else { throw ArgumentError("Cannot divide by zero"); } } } void main() { Calculator calculator = Calculator(); double num1 = 10; double num2 = 5; print("$num1 + $num2 = ${calculator.add(num1, num2)}"); print("$num1 - $num2 = ${calculator.subtract(num1, num2)}"); print("$num1 * $num2 = ${calculator.multiply(num1, num2)}"); print("$num1 / $num2 = ${calculator.divide(num1, num2)}"); }
0
mirrored_repositories/Flutter-Journey/Dart Language/code/self-learn/pre-rec
mirrored_repositories/Flutter-Journey/Dart Language/code/self-learn/pre-rec/oop/encapsulation.dart
class Person { String? _name; int? _age; // Private attribute Person(String name, int age) { _name = name; _age = age; } String get name => _name!; // Getter int get age => _age!; // Getter void introduce() { print('Hello, my name is $_name'); } } void main() { Person person = Person('Alice', 20); //person.introduce(); print('Name: ${person.name} and Age: ${person._age}'); }
0
mirrored_repositories/Flutter-Journey/Dart Language/code/self-learn/pre-rec
mirrored_repositories/Flutter-Journey/Dart Language/code/self-learn/pre-rec/oop/encap_2.dart
class BankAccount { String accountNumber = ''; double _balance = 0; // Private attribute BankAccount(this.accountNumber, double initialBalance) { _balance = initialBalance; } double? get balance => _balance; // Getter for private attribute _balance void deposit(double amount) { _balance += amount; print('Deposited $amount. New balance: $_balance'); } void _deductFee() { _balance -= 10.0; print('Fee deducted. New balance: $_balance'); } void performTransaction(double amount) { if (amount > 0) { deposit(amount); } else { _deductFee(); } } } void main() { BankAccount account = BankAccount('123456', 100.0); print( 'Initial balance: ${account.balance}'); // Output: Initial balance: 100.0 account .performTransaction(50.0); // Output: Deposited 50.0. New balance: 150.0 account.performTransaction(-30.0); // Output: Fee deducted. New balance: 140.0 }
0
mirrored_repositories/Flutter-Journey/Dart Language/code/self-learn/pre-rec
mirrored_repositories/Flutter-Journey/Dart Language/code/self-learn/pre-rec/oop/single_tone.dart
class Person { final String name; final int age; Person(this.name, this.age); } class SingletonPerson { // Private constructor SingletonPerson._privateConstructor(); // Static instance variable static final SingletonPerson _instance = SingletonPerson._privateConstructor(); // Getter for the instance static SingletonPerson get instance => _instance; // Properties of a person final List<Person> _persons = []; // Method to add a person to the list void addPerson(String name, int age) { _persons.add(Person(name, age)); } void removePerson(int age) { //_persons.removeWhere((person) => person.age == age); _persons.removeWhere((person) { if (person.age == age) { return true; } else { return false; } }); } // Method to display all persons void displayPersons() { for (var person in _persons) { print("Name: ${person.name}, Age: ${person.age}"); } } } void main() { SingletonPerson singletonPerson = SingletonPerson.instance; singletonPerson.addPerson("Alice", 25); singletonPerson.addPerson("Bob", 30); singletonPerson.addPerson("Bob1", 30); singletonPerson.addPerson("Bob2", 300); singletonPerson.displayPersons(); singletonPerson.removePerson(300); print('\n\n\t- - - - - - - - - - - - - After removing Bob'); singletonPerson.displayPersons(); }
0
mirrored_repositories/Flutter-Journey/Dart Language/code
mirrored_repositories/Flutter-Journey/Dart Language/code/7-loop/2_while.dart
void main() { int initlia = 0; while (initlia <= 10) { print(initlia); initlia++; } }
0
mirrored_repositories/Flutter-Journey/Dart Language/code
mirrored_repositories/Flutter-Journey/Dart Language/code/7-loop/1_for.dart
void main() { for (int i = 0; i < 10; i++) { print(i); } /// another way write for loop int initial = 0; for (; initial < 10;) { print(initial); initial++; } /// another way write for loop int initial2 = 0; for (;;) { if (initial2 < 10) { print(initial2); initial2++; } else { break; } } /// infinite loop /* for (;;) { print('infinite loop'); } */ List<String> names = ['Jack', 'Jill', 'Tom']; // for in loops for (String name in names) { print(name); } for (int i = 0; i < names.length; i++) { print('${names[i]} is a student '); } }
0
mirrored_repositories/Flutter-Journey/Dart Language/code
mirrored_repositories/Flutter-Journey/Dart Language/code/7-loop/4_map_loop.dart
void main() { Map<String, String> map = { 'name': 'Jack', 'age': '20', 'city': 'New York', }; for (String key in map.keys) { print('$key : ${map[key]} && value : ${map.values}'); } print("\t- - - - - - - - - - - - - "); map.forEach((key, value) { print('$key : $value'); }); }
0
mirrored_repositories/Flutter-Journey/Dart Language/code
mirrored_repositories/Flutter-Journey/Dart Language/code/7-loop/3_do_while.dart
void main() {}
0
mirrored_repositories/Flutter-Journey/Dart Language
mirrored_repositories/Flutter-Journey/Dart Language/FullDart/5_class_3.dart
void main(List<String> args) { User us1 = User(firstName: 'sakib', lastName: 'hasan'); User us2 = User(firstName: 'abir', lastName: 'ahmed'); } class User { final String firstName; final String lastName; const User({required this.firstName, required this.lastName}); // bool operator ==(Object other) { // if (identical(this, other)) return true; // } }
0
mirrored_repositories/Flutter-Journey/Dart Language
mirrored_repositories/Flutter-Journey/Dart Language/FullDart/4_enum.dart
enum typeOfAccount { bussinges, free, premium } void main() { final userAccount = typeOfAccount.bussinges; print(' $userAccount'); switch (userAccount) { case typeOfAccount.bussinges: print('100 usd'); break; case typeOfAccount.free: print('0 usd'); break; default: print("no type matched"); } }
0
mirrored_repositories/Flutter-Journey/Dart Language
mirrored_repositories/Flutter-Journey/Dart Language/FullDart/collections.dart
void main() { bool isSignedIn = true; // <String>[ // 'This is a fake shot', // 'son of bitch', // if (isSignedIn) 'sin up' else 'sine in', // ]; // final x = <String>[ // for (int start = 0; start < 5; start) start.toString(), // for (final num in [1, 2, 3]) num.toString(), // ]; print("sajjad"); } //TODO: // more read about collections in dart // see more handson example
0
mirrored_repositories/Flutter-Journey/Dart Language
mirrored_repositories/Flutter-Journey/Dart Language/FullDart/5_class_2.dart
class Example { int public; int _private; Example(this.public, this._private); Example.namedConstructor( {required this.public, required int privateParameter}) : _private = privateParameter; int get getPrivate => _private; // Getter for _private set setPrivate(int newValue) { _private = newValue; // Setter for _private } }
0
mirrored_repositories/Flutter-Journey/Dart Language
mirrored_repositories/Flutter-Journey/Dart Language/FullDart/5_class.dart
void main() { var namePerson = User(name: 'aaaaaaaa', photoUrl: 'sas.com'); print(namePerson.name); } class User { final String name; final String photoUrl; const User({required this.name, required this.photoUrl}); bool hasLongName() { return name.length > 5; } static void myMethod() {} static const minNameLength = 3; }
0
mirrored_repositories/Flutter-Journey/Dart Language
mirrored_repositories/Flutter-Journey/Dart Language/FullDart/3_anynomus.dart
int? twice(int Function(int) f) { return f(f(3)); } // missing it void main() { var reslut = twice((c) => c * 3); print(reslut); }
0
mirrored_repositories/Flutter-Journey/Dart Language
mirrored_repositories/Flutter-Journey/Dart Language/FullDart/2_methods.dart
int? twice(int Function(int) f) { return f(f(2)); } void main() { int? result = twice((int x) { return x * 2; }); print(result); // Output: Instance of '_Closure' }
0
mirrored_repositories/Flutter-Journey/Dart Language
mirrored_repositories/Flutter-Journey/Dart Language/FullDart/1_first.dart
void main(List<String> args) { positionalOptionalParameter(1, 2.0, 'Sajjad'); } // first method -> cont and final void besicShow() { String? name = 'Dart'; String? firstName = null; final String lastName; lastName = 'Language'; //lastName = "hi"; // error const String middleName = 'FullDart'; //middleName = 'hi'; // error // the difference between final and const is that //const is a compile-time constant while final is a run-time constant. // const and final are immutable. immutable means that the variable cannot be changed after it is initialized. // difference between final and const is that const must be initialized with a constant value. // final can be initialized with a value computed at run time. //similar between final and const is that they both are immutable. // but final is initialized when accessed while const is initialized at compile time. //compile time means when the code is converted to machine code. //run time means when the code is running. // which one occure first? compile time or run time? // compile time occure first then run time. // so const is initialized before final. print(firstName?.length); // null } // difference / and ~/ void mathBitOperation() { double tata = 6 / 5; print(tata); print(tata.runtimeType); int tata2 = 6 ~/ 5; print(tata2); } // optional Pram in METHOD void positionalOptionalParameter(int x, double y, [String? z = "hi"]) { // positionalOptionalParameter(1, 2.0); print('x = $x and $y also $z'); // positionalOptionalParameter(1, 2.0, 'Sajjad'); } void namedPram({int? num1, int? num2, String? name}) { namedPram(name: "abir", num1: 23, num2: 24); // closer look the method parameters ; in named param we can define any order } void requriedNamedParam({int? x, int? y, String? greetings}) { requriedNamedParam(greetings: 'sakib', x: 75, y: 90); }
0
mirrored_repositories/Flutter-Journey/Dart Language
mirrored_repositories/Flutter-Journey/Dart Language/FullDart/main.dart
import '5_class_2.dart'; void main() { var a = Example(1, 4); a.public; a.getPrivate; a.setPrivate = 5; print(a.getPrivate); }
0
mirrored_repositories/Flutter-Journey/Dart Language
mirrored_repositories/Flutter-Journey/Dart Language/FullDart/map_ls.dart
void main() { final name = ['sajjad', 'sakib', 'sakira']; final nameLength = name.map((name) => name.length); final nameFilter = name.where((name) => name.length == 6).toList(); for (var a in nameFilter) { print(a + ' '); } print("full list = $nameFilter"); nameFilter.forEach((element) { print(element); }); }
0
mirrored_repositories/facebook_flutter
mirrored_repositories/facebook_flutter/lib/main.dart
import 'dart:io'; import 'package:conditional_builder_null_safety/conditional_builder_null_safety.dart'; import 'package:facebook/layout/home/home_cubit/home_cubit.dart'; import 'package:facebook/modul/login/login_screen.dart'; import 'package:facebook/shared/components/bloc_observer.dart'; import 'package:facebook/shared/components/constant.dart'; import 'package:facebook/shared/style/color.dart'; import 'package:facebook/shared/style/custom_icons_icons.dart'; import 'package:facebook/shared/style/icon_broken.dart'; import 'package:facebook/web/modul/login/login_screen.dart'; import 'package:firebase_core/firebase_core.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'modul/home_page/home_page_screen.dart'; import 'modul/login/login_cubit/login_cubit.dart'; main() async { WidgetsFlutterBinding.ensureInitialized(); await Firebase.initializeApp(); Bloc.observer = MyBlocObserver(); editStatusBar(); runApp(MyApp()); } class MyApp extends StatefulWidget { const MyApp({Key? key}) : super(key: key); @override _MyAppState createState() => _MyAppState(); } class _MyAppState extends State<MyApp> with SingleTickerProviderStateMixin { TabController? tabController; ScrollController? scrollController; @override void initState() { super.initState(); tabController = TabController(vsync: this, length: 2, initialIndex: 0); scrollController = ScrollController(); } @override Widget build(BuildContext context) { return MultiBlocProvider( providers: [ BlocProvider( create: (BuildContext context) => LoginCubit(), ), ], child: MaterialApp( debugShowCheckedModeBanner: false, home: ConditionalBuilder( condition: kIsWeb, builder: (context) { return LoginScreenWeb(); }, fallback: (context) { return LoginScreen(); }, ), ), ); } }
0
mirrored_repositories/facebook_flutter/lib/shared
mirrored_repositories/facebook_flutter/lib/shared/components/bloc_observer.dart
import 'package:bloc/bloc.dart'; class MyBlocObserver extends BlocObserver { @override void onCreate(BlocBase bloc) { super.onCreate(bloc); print('onCreate -- ${bloc.runtimeType}'); } @override void onChange(BlocBase bloc, Change change) { super.onChange(bloc, change); print('onChange -- ${bloc.runtimeType}, $change'); } @override void onError(BlocBase bloc, Object error, StackTrace stackTrace) { print('onError -- ${bloc.runtimeType}, $error'); super.onError(bloc, error, stackTrace); } @override void onClose(BlocBase bloc) { super.onClose(bloc); print('onClose -- ${bloc.runtimeType}'); } } //Bloc.observer = MyBlocObserver();
0
mirrored_repositories/facebook_flutter/lib/shared
mirrored_repositories/facebook_flutter/lib/shared/components/component.dart
import 'package:flutter/material.dart'; class DefaultTextFormField extends StatelessWidget { final String hint; final TextEditingController controller; TextInputType? textInputType; bool isHide; Widget? suffixIcon; Widget? prefixIcon; FormFieldValidator<String>? validator; ValueChanged<String>? onChanged; DefaultTextFormField({ required this.hint, required this.controller, this.isHide = false, this.suffixIcon, this.prefixIcon, this.validator, this.onChanged, this.textInputType, }); @override Widget build(BuildContext context) { return TextFormField( controller: controller, validator: validator, textAlign: TextAlign.end, onChanged: onChanged, decoration: InputDecoration( hintText: '$hint', suffixIcon: suffixIcon, prefixIcon: prefixIcon, ), keyboardType: textInputType, obscureText: isHide, ); } } void navigateAndFinish({ required BuildContext context, required Widget widget, }) { Navigator.pushAndRemoveUntil( context, MaterialPageRoute( builder: (context) => widget, ), (route) => false, ); } void navigateTo({ required BuildContext context, required Widget widget, }){ Navigator.push(context, MaterialPageRoute(builder: (context)=> widget)); } void navigateBack(context){ Navigator.pop(context); }
0
mirrored_repositories/facebook_flutter/lib/shared
mirrored_repositories/facebook_flutter/lib/shared/components/constant.dart
import 'package:arabic_numbers/arabic_numbers.dart'; import 'package:facebook/shared/style/color.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; editStatusBar({Color color = secondaryColor, Brightness icon = Brightness.light}){ SystemChrome.setSystemUIOverlayStyle( SystemUiOverlayStyle( statusBarColor: color, statusBarIconBrightness: icon, ), ); } final ArabicNumbers arabicNumber = ArabicNumbers();
0
mirrored_repositories/facebook_flutter/lib/shared
mirrored_repositories/facebook_flutter/lib/shared/style/custom_icons_icons.dart
import 'package:flutter/widgets.dart'; class CustomIcons { CustomIcons._(); static const _kFontFam = 'CustomIcons'; static const String? _kFontPkg = null; static const IconData facebook = IconData(0xe800, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData bell_noti = IconData(0xe804, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData menu = IconData(0xe805, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData search_icon = IconData(0xe806, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData mess_icon = IconData(0xe807, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData account_group_1 = IconData(0xe808, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData store = IconData(0xe80d, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData group = IconData(0xe80e, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData video_player = IconData(0xe80f, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData bell__2_ = IconData(0xe818, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData comment_svgrepo_com = IconData(0xe819, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData like_svgrepo_com = IconData(0xe81a, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData arrow_curved_to_the_left_svgrepo_com = IconData(0xe81b, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData gallery = IconData(0xe81f, fontFamily: _kFontFam, fontPackage: _kFontPkg); }
0
mirrored_repositories/facebook_flutter/lib/shared
mirrored_repositories/facebook_flutter/lib/shared/style/color.dart
import 'package:flutter/material.dart'; const primaryColor = Color(0xff2d87ff); const secondaryColor = Color(0xff053d87); const color2 = Color(0xff30a24b);
0
mirrored_repositories/facebook_flutter/lib/shared
mirrored_repositories/facebook_flutter/lib/shared/style/icon_broken.dart
// Place fonts/icons.ttf in your fonts/ directory and // add the following to your pubspec.yaml // flutter: // fonts: // - family: Iconly-Broken // fonts: // - asset: fonts/icons.ttf import 'package:flutter/widgets.dart'; class IconBroken { IconBroken._(); static const String _fontFamily = 'IconBroken'; static const IconData User = IconData(0xe900, fontFamily: _fontFamily); static const IconData User1 = IconData(0xe901, fontFamily: _fontFamily); static const IconData Activity = IconData(0xe902, fontFamily: _fontFamily); static const IconData Add_User = IconData(0xe903, fontFamily: _fontFamily); static const IconData Arrow___Down_2 = IconData(0xe904, fontFamily: _fontFamily); static const IconData Arrow___Down_3 = IconData(0xe905, fontFamily: _fontFamily); static const IconData Arrow___Down_Circle = IconData(0xe906, fontFamily: _fontFamily); static const IconData Arrow___Down_Square = IconData(0xe907, fontFamily: _fontFamily); static const IconData Arrow___Down = IconData(0xe908, fontFamily: _fontFamily); static const IconData Arrow___Left_2 = IconData(0xe909, fontFamily: _fontFamily); static const IconData Arrow___Left_3 = IconData(0xe90a, fontFamily: _fontFamily); static const IconData Arrow___Left_Circle = IconData(0xe90b, fontFamily: _fontFamily); static const IconData Arrow___Left_Square = IconData(0xe90c, fontFamily: _fontFamily); static const IconData Arrow___Left = IconData(0xe90d, fontFamily: _fontFamily); static const IconData Arrow___Right_2 = IconData(0xe90e, fontFamily: _fontFamily); static const IconData Arrow___Right_3 = IconData(0xe90f, fontFamily: _fontFamily); static const IconData Arrow___Right_Circle = IconData(0xe910, fontFamily: _fontFamily); static const IconData Arrow___Right_Square = IconData(0xe911, fontFamily: _fontFamily); static const IconData Arrow___Right = IconData(0xe912, fontFamily: _fontFamily); static const IconData Arrow___Up_2 = IconData(0xe913, fontFamily: _fontFamily); static const IconData Arrow___Up_3 = IconData(0xe914, fontFamily: _fontFamily); static const IconData Arrow___Up_Circle = IconData(0xe915, fontFamily: _fontFamily); static const IconData Arrow___Up_Square = IconData(0xe916, fontFamily: _fontFamily); static const IconData Arrow___Up = IconData(0xe917, fontFamily: _fontFamily); static const IconData Bag_2 = IconData(0xe918, fontFamily: _fontFamily); static const IconData Bag = IconData(0xe919, fontFamily: _fontFamily); static const IconData Bookmark = IconData(0xe91a, fontFamily: _fontFamily); static const IconData Buy = IconData(0xe91b, fontFamily: _fontFamily); static const IconData Calendar = IconData(0xe91c, fontFamily: _fontFamily); static const IconData Call_Missed = IconData(0xe91d, fontFamily: _fontFamily); static const IconData Call_Silent = IconData(0xe91e, fontFamily: _fontFamily); static const IconData Call = IconData(0xe91f, fontFamily: _fontFamily); static const IconData Calling = IconData(0xe920, fontFamily: _fontFamily); static const IconData Camera = IconData(0xe921, fontFamily: _fontFamily); static const IconData Category = IconData(0xe922, fontFamily: _fontFamily); static const IconData Chart = IconData(0xe923, fontFamily: _fontFamily); static const IconData Chat = IconData(0xe924, fontFamily: _fontFamily); static const IconData Close_Square = IconData(0xe925, fontFamily: _fontFamily); static const IconData Danger = IconData(0xe926, fontFamily: _fontFamily); static const IconData Delete = IconData(0xe927, fontFamily: _fontFamily); static const IconData Discount = IconData(0xe928, fontFamily: _fontFamily); static const IconData Discovery = IconData(0xe929, fontFamily: _fontFamily); static const IconData Document = IconData(0xe92a, fontFamily: _fontFamily); static const IconData Download = IconData(0xe92b, fontFamily: _fontFamily); static const IconData Edit_Square = IconData(0xe92c, fontFamily: _fontFamily); static const IconData Edit = IconData(0xe92d, fontFamily: _fontFamily); static const IconData Filter_2 = IconData(0xe92e, fontFamily: _fontFamily); static const IconData Filter = IconData(0xe92f, fontFamily: _fontFamily); static const IconData Folder = IconData(0xe930, fontFamily: _fontFamily); static const IconData Game = IconData(0xe931, fontFamily: _fontFamily); static const IconData Graph = IconData(0xe932, fontFamily: _fontFamily); static const IconData Heart = IconData(0xe933, fontFamily: _fontFamily); static const IconData Hide = IconData(0xe934, fontFamily: _fontFamily); static const IconData Home = IconData(0xe935, fontFamily: _fontFamily); static const IconData Image_2 = IconData(0xe936, fontFamily: _fontFamily); static const IconData Image = IconData(0xe937, fontFamily: _fontFamily); static const IconData Info_Circle = IconData(0xe938, fontFamily: _fontFamily); static const IconData Info_Square = IconData(0xe939, fontFamily: _fontFamily); static const IconData Location = IconData(0xe93a, fontFamily: _fontFamily); static const IconData Lock = IconData(0xe93b, fontFamily: _fontFamily); static const IconData Login = IconData(0xe93c, fontFamily: _fontFamily); static const IconData Logout = IconData(0xe93d, fontFamily: _fontFamily); static const IconData Message = IconData(0xe93e, fontFamily: _fontFamily); static const IconData More_Circle = IconData(0xe93f, fontFamily: _fontFamily); static const IconData More_Square = IconData(0xe940, fontFamily: _fontFamily); static const IconData Notification = IconData(0xe941, fontFamily: _fontFamily); static const IconData Paper_Download = IconData(0xe942, fontFamily: _fontFamily); static const IconData Paper_Fail = IconData(0xe943, fontFamily: _fontFamily); static const IconData Paper_Negative = IconData(0xe944, fontFamily: _fontFamily); static const IconData Paper_Plus = IconData(0xe945, fontFamily: _fontFamily); static const IconData Paper_Upload = IconData(0xe946, fontFamily: _fontFamily); static const IconData Paper = IconData(0xe947, fontFamily: _fontFamily); static const IconData Password = IconData(0xe948, fontFamily: _fontFamily); static const IconData Play = IconData(0xe949, fontFamily: _fontFamily); static const IconData Plus = IconData(0xe94a, fontFamily: _fontFamily); static const IconData Profile = IconData(0xe94b, fontFamily: _fontFamily); static const IconData Scan = IconData(0xe94c, fontFamily: _fontFamily); static const IconData Search = IconData(0xe94d, fontFamily: _fontFamily); static const IconData Send = IconData(0xe94e, fontFamily: _fontFamily); static const IconData Setting = IconData(0xe94f, fontFamily: _fontFamily); static const IconData Shield_Done = IconData(0xe950, fontFamily: _fontFamily); static const IconData Shield_Fail = IconData(0xe951, fontFamily: _fontFamily); static const IconData Show = IconData(0xe952, fontFamily: _fontFamily); static const IconData Star = IconData(0xe953, fontFamily: _fontFamily); static const IconData Swap = IconData(0xe954, fontFamily: _fontFamily); static const IconData Tick_Square = IconData(0xe955, fontFamily: _fontFamily); static const IconData Ticket_Star = IconData(0xe956, fontFamily: _fontFamily); static const IconData Ticket = IconData(0xe957, fontFamily: _fontFamily); static const IconData Time_Circle = IconData(0xe958, fontFamily: _fontFamily); static const IconData Time_Square = IconData(0xe959, fontFamily: _fontFamily); static const IconData Unlock = IconData(0xe95a, fontFamily: _fontFamily); static const IconData Upload = IconData(0xe95b, fontFamily: _fontFamily); static const IconData Video = IconData(0xe95c, fontFamily: _fontFamily); static const IconData Voice_2 = IconData(0xe95d, fontFamily: _fontFamily); static const IconData Voice = IconData(0xe95e, fontFamily: _fontFamily); static const IconData Volume_Down = IconData(0xe95f, fontFamily: _fontFamily); static const IconData Volume_Off = IconData(0xe960, fontFamily: _fontFamily); static const IconData Volume_Up = IconData(0xe961, fontFamily: _fontFamily); static const IconData Wallet = IconData(0xe962, fontFamily: _fontFamily); static const IconData Work = IconData(0xe963, fontFamily: _fontFamily); }
0
mirrored_repositories/facebook_flutter/lib/modul
mirrored_repositories/facebook_flutter/lib/modul/home_page/home_page_screen.dart
import 'package:animations/animations.dart'; import 'package:facebook/layout/home/home_cubit/home_cubit.dart'; import 'package:facebook/layout/home/home_cubit/home_states.dart'; import 'package:facebook/model/local_data.dart'; import 'package:facebook/modul/posts/post_five.dart'; import 'package:facebook/shared/components/constant.dart'; import 'package:facebook/shared/style/color.dart'; import 'package:facebook/shared/style/custom_icons_icons.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:scrollable_positioned_list/scrollable_positioned_list.dart'; import 'package:stack_percentage/stack_percentage.dart'; import 'package:page_transition/page_transition.dart'; class HomePageScreen extends StatelessWidget { final ItemScrollController itemScrollController = ItemScrollController(); Future moveToIndex(int index)async{ itemScrollController.jumpTo(index: index); } List<Widget> returnWidgets({ bool isCovered = false, required LocalData usersFour, }){ return [ Padding( padding: const EdgeInsets.symmetric(horizontal: 15), child: Row( children: [ IconButton( padding: EdgeInsetsDirectional.zero, onPressed: () {}, icon: Icon( Icons.more_horiz_rounded, color: Colors.grey[700], ), ), Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.end, mainAxisSize: MainAxisSize.min, children: [ Text( '${usersFour.name}', textAlign: TextAlign.end, style: TextStyle( fontWeight: FontWeight.bold, ), ), Row( mainAxisAlignment: MainAxisAlignment.end, children: [ Padding( padding: const EdgeInsets.symmetric(horizontal: 8.0), child: Icon( Icons.public_rounded, color: Colors.grey[700], size: 16, ), ), Text( '${usersFour.date}', textAlign: TextAlign.end, style: TextStyle( fontSize: 12, ), ), ], ), ], ), ), Padding( padding: const EdgeInsetsDirectional.only(start: 15), child: Align( alignment: AlignmentDirectional.topEnd, child: Container( width: 40, height: 40, decoration: BoxDecoration( borderRadius: BorderRadius.circular(20), color: Colors.blue, border: Border.all( color: primaryColor, width: 2.3, ), image: DecorationImage( image: NetworkImage( '${usersFour.url}', ), fit: BoxFit.cover), ), ), ), ), ], ), ), Padding( padding: const EdgeInsets.symmetric(horizontal: 15), child: Column( crossAxisAlignment: CrossAxisAlignment.end, children: [ Wrap( children: [ Text( '${usersFour.post}', maxLines: 3, overflow: TextOverflow.ellipsis, textAlign: TextAlign.end, style: TextStyle( fontWeight: FontWeight.w500, fontSize: 14, ), ), ], ), ], ), ), Padding( padding: const EdgeInsetsDirectional.all(15.0), child: Row( children: [ Text( '${usersFour.share_count}', textDirection: TextDirection.rtl, style: TextStyle( color: Colors.grey, ), ), SizedBox( width: 5, ), Text( '${usersFour.comment_count}', textDirection: TextDirection.rtl, style: TextStyle( color: Colors.grey, ), ), Expanded( child: Container( height: 20, child: Wrap( direction: Axis.horizontal, alignment: WrapAlignment.end, crossAxisAlignment: WrapCrossAlignment.center, children: [ Text( '${usersFour.like_count}', textDirection: TextDirection.rtl, style: TextStyle( color: Colors.grey, ), ), Stack( children: [ Container( width: 55, height: 20, ), PositionedDirectional( end: 0, child: Container( height: 20, width: 20, decoration: BoxDecoration( border: Border.all( color: Colors.white, width: 1.5), borderRadius: BorderRadius.circular(18)), child: SvgPicture.asset( '${usersFour.first_rect}', ), ), ), PositionedDirectional( end: 16, child: Container( height: 20, width: 20, decoration: BoxDecoration( border: Border.all( color: Colors.white, width: 1.5), borderRadius: BorderRadius.circular(18)), child: SvgPicture.asset( '${usersFour.second_rect}', ), ), ), PositionedDirectional( end: 32, child: Container( height: 20, width: 20, decoration: BoxDecoration( border: Border.all( color: Colors.white, width: 1.5), borderRadius: BorderRadius.circular(18)), child: SvgPicture.asset( '${usersFour.thirty_rect}', ), ), ), ], ), ], ), ), ), ], ), ), SizedBox( height: 0, ), Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Expanded( child: Container( child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Text( 'مشاركة', style: TextStyle( color: Colors.grey, fontWeight: FontWeight.w600, ), ), Icon( CustomIcons .arrow_curved_to_the_left_svgrepo_com, color: Colors.grey, ), ], ), ), ), Expanded( child: Container( child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Text( 'تعليق', style: TextStyle( color: Colors.grey, fontWeight: FontWeight.w600, ), ), Icon( CustomIcons.comment_svgrepo_com, color: Colors.grey, ), ], ), ), ), Expanded( child: Container( child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Text( 'أعجبنى', style: TextStyle( color: Colors.grey, fontWeight: FontWeight.w600, ), ), SizedBox( width: 10, ), Icon( CustomIcons.like_svgrepo_com, color: Colors.grey, size: 20, ), ], ), ), ), ], ), SizedBox( height: 10, ), Container( color: Colors.green, width: double.infinity, height: 600, child: Image( image: NetworkImage( '${usersFour.post_image}', ), fit: isCovered? BoxFit.cover : null, ), ), SizedBox( height: 15, ), Padding( padding: const EdgeInsets.symmetric(horizontal: 15), child: Row( children: [ Text( '${usersFour.share_count}', textDirection: TextDirection.rtl, style: TextStyle( color: Colors.grey, ), ), SizedBox( width: 5, ), Text( '${usersFour.comment_count}', textDirection: TextDirection.rtl, style: TextStyle( color: Colors.grey, ), ), Expanded( child: Container( height: 20, child: Wrap( direction: Axis.horizontal, alignment: WrapAlignment.end, crossAxisAlignment: WrapCrossAlignment.center, children: [ Text( '${usersFour.like_count}', textDirection: TextDirection.rtl, style: TextStyle( color: Colors.grey, ), ), Stack( children: [ Container( width: 55, height: 20, ), PositionedDirectional( end: 0, child: Container( height: 20, width: 20, decoration: BoxDecoration( border: Border.all( color: Colors.white, width: 1.5), borderRadius: BorderRadius.circular(18)), child: SvgPicture.asset( '${usersFour.first_rect}', ), ), ), PositionedDirectional( end: 16, child: Container( height: 20, width: 20, decoration: BoxDecoration( border: Border.all( color: Colors.white, width: 1.5), borderRadius: BorderRadius.circular(18)), child: SvgPicture.asset( '${usersFour.second_rect}', ), ), ), PositionedDirectional( end: 32, child: Container( height: 20, width: 20, decoration: BoxDecoration( border: Border.all( color: Colors.white, width: 1.5), borderRadius: BorderRadius.circular(18)), child: SvgPicture.asset( '${usersFour.thirty_rect}', ), ), ), ], ), ], ), ), ), ], ), ), SizedBox( height: 15, ), Row( children: [ Expanded( child: Container( child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Text( 'مشاركة', style: TextStyle( color: Colors.grey, fontWeight: FontWeight.w600, ), ), Icon( CustomIcons .arrow_curved_to_the_left_svgrepo_com, color: Colors.grey, ), ], ), ), ), Expanded( child: Container( child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Text( 'تعليق', style: TextStyle( color: Colors.grey, fontWeight: FontWeight.w600, ), ), Icon( CustomIcons.comment_svgrepo_com, color: Colors.grey, ), ], ), ), ), Expanded( child: Container( child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Text( 'أعجبنى', style: TextStyle( color: Colors.grey, fontWeight: FontWeight.w600, ), ), SizedBox( width: 10, ), Icon( CustomIcons.like_svgrepo_com, color: Colors.grey, size: 20, ), ], ), ), ), ], ), SizedBox( height: 10, ), Container( color: Colors.green, width: double.infinity, height: 600, child: Image( image: NetworkImage( '${usersFour.two_post_image}', ), fit: isCovered? BoxFit.cover : BoxFit.none, ), ), SizedBox( height: 15, ), Padding( padding: const EdgeInsets.symmetric(horizontal: 15), child: Row( children: [ Text( '${usersFour.share_count}', textDirection: TextDirection.rtl, style: TextStyle( color: Colors.grey, ), ), SizedBox( width: 5, ), Text( '${usersFour.comment_count}', textDirection: TextDirection.rtl, style: TextStyle( color: Colors.grey, ), ), Expanded( child: Container( height: 20, child: Wrap( direction: Axis.horizontal, alignment: WrapAlignment.end, crossAxisAlignment: WrapCrossAlignment.center, children: [ Text( '${usersFour.like_count}', textDirection: TextDirection.rtl, style: TextStyle( color: Colors.grey, ), ), Stack( children: [ Container( width: 55, height: 20, ), PositionedDirectional( end: 0, child: Container( height: 20, width: 20, decoration: BoxDecoration( border: Border.all( color: Colors.white, width: 1.5), borderRadius: BorderRadius.circular(18)), child: SvgPicture.asset( '${usersFour.first_rect}', ), ), ), PositionedDirectional( end: 16, child: Container( height: 20, width: 20, decoration: BoxDecoration( border: Border.all( color: Colors.white, width: 1.5), borderRadius: BorderRadius.circular(18)), child: SvgPicture.asset( '${usersFour.second_rect}', ), ), ), PositionedDirectional( end: 32, child: Container( height: 20, width: 20, decoration: BoxDecoration( border: Border.all( color: Colors.white, width: 1.5), borderRadius: BorderRadius.circular(18)), child: SvgPicture.asset( '${usersFour.thirty_rect}', ), ), ), ], ), ], ), ), ), ], ), ), SizedBox( height: 15, ), Row( children: [ Expanded( child: Container( child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Text( 'مشاركة', style: TextStyle( color: Colors.grey, fontWeight: FontWeight.w600, ), ), Icon( CustomIcons .arrow_curved_to_the_left_svgrepo_com, color: Colors.grey, ), ], ), ), ), Expanded( child: Container( child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Text( 'تعليق', style: TextStyle( color: Colors.grey, fontWeight: FontWeight.w600, ), ), Icon( CustomIcons.comment_svgrepo_com, color: Colors.grey, ), ], ), ), ), Expanded( child: Container( child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Text( 'أعجبنى', style: TextStyle( color: Colors.grey, fontWeight: FontWeight.w600, ), ), SizedBox( width: 10, ), Icon( CustomIcons.like_svgrepo_com, color: Colors.grey, size: 20, ), ], ), ), ), ], ), SizedBox( height: 10, ), Container( color: Colors.green, width: double.infinity, height: 600, child: Image( image: NetworkImage( '${usersFour.three_post_image}', ), fit: isCovered? BoxFit.cover : BoxFit.none, ), ), SizedBox( height: 15, ), Padding( padding: const EdgeInsets.symmetric(horizontal: 15), child: Row( children: [ Text( '${usersFour.share_count}', textDirection: TextDirection.rtl, style: TextStyle( color: Colors.grey, ), ), SizedBox( width: 5, ), Text( '${usersFour.comment_count}', textDirection: TextDirection.rtl, style: TextStyle( color: Colors.grey, ), ), Expanded( child: Container( height: 20, child: Wrap( direction: Axis.horizontal, alignment: WrapAlignment.end, crossAxisAlignment: WrapCrossAlignment.center, children: [ Text( '${usersFour.like_count}', textDirection: TextDirection.rtl, style: TextStyle( color: Colors.grey, ), ), Stack( children: [ Container( width: 55, height: 20, ), PositionedDirectional( end: 0, child: Container( height: 20, width: 20, decoration: BoxDecoration( border: Border.all( color: Colors.white, width: 1.5), borderRadius: BorderRadius.circular(18)), child: SvgPicture.asset( '${usersFour.first_rect}', ), ), ), PositionedDirectional( end: 16, child: Container( height: 20, width: 20, decoration: BoxDecoration( border: Border.all( color: Colors.white, width: 1.5), borderRadius: BorderRadius.circular(18)), child: SvgPicture.asset( '${usersFour.second_rect}', ), ), ), PositionedDirectional( end: 32, child: Container( height: 20, width: 20, decoration: BoxDecoration( border: Border.all( color: Colors.white, width: 1.5), borderRadius: BorderRadius.circular(18)), child: SvgPicture.asset( '${usersFour.thirty_rect}', ), ), ), ], ), ], ), ), ), ], ), ), SizedBox( height: 15, ), Row( children: [ Expanded( child: Container( child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Text( 'مشاركة', style: TextStyle( color: Colors.grey, fontWeight: FontWeight.w600, ), ), Icon( CustomIcons .arrow_curved_to_the_left_svgrepo_com, color: Colors.grey, ), ], ), ), ), Expanded( child: Container( child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Text( 'تعليق', style: TextStyle( color: Colors.grey, fontWeight: FontWeight.w600, ), ), Icon( CustomIcons.comment_svgrepo_com, color: Colors.grey, ), ], ), ), ), Expanded( child: Container( child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Text( 'أعجبنى', style: TextStyle( color: Colors.grey, fontWeight: FontWeight.w600, ), ), SizedBox( width: 10, ), Icon( CustomIcons.like_svgrepo_com, color: Colors.grey, size: 20, ), ], ), ), ), ], ), SizedBox( height: 10, ), Container( color: Colors.green, width: double.infinity, height: 600, child: Image( image: NetworkImage( '${usersFour.four_post_image}', ), fit: isCovered? BoxFit.cover : BoxFit.none, ), ), SizedBox( height: 15, ), Padding( padding: const EdgeInsets.symmetric(horizontal: 15), child: Row( children: [ Text( '${usersFour.share_count}', textDirection: TextDirection.rtl, style: TextStyle( color: Colors.grey, ), ), SizedBox( width: 5, ), Text( '${usersFour.comment_count}', textDirection: TextDirection.rtl, style: TextStyle( color: Colors.grey, ), ), Expanded( child: Container( height: 20, child: Wrap( direction: Axis.horizontal, alignment: WrapAlignment.end, crossAxisAlignment: WrapCrossAlignment.center, children: [ Text( '${usersFour.like_count}', textDirection: TextDirection.rtl, style: TextStyle( color: Colors.grey, ), ), Stack( children: [ Container( width: 55, height: 20, ), PositionedDirectional( end: 0, child: Container( height: 20, width: 20, decoration: BoxDecoration( border: Border.all( color: Colors.white, width: 1.5), borderRadius: BorderRadius.circular(18)), child: SvgPicture.asset( '${usersFour.first_rect}', ), ), ), PositionedDirectional( end: 16, child: Container( height: 20, width: 20, decoration: BoxDecoration( border: Border.all( color: Colors.white, width: 1.5), borderRadius: BorderRadius.circular(18)), child: SvgPicture.asset( '${usersFour.second_rect}', ), ), ), PositionedDirectional( end: 32, child: Container( height: 20, width: 20, decoration: BoxDecoration( border: Border.all( color: Colors.white, width: 1.5), borderRadius: BorderRadius.circular(18)), child: SvgPicture.asset( '${usersFour.thirty_rect}', ), ), ), ], ), ], ), ), ), ], ), ), SizedBox( height: 15, ), Row( children: [ Expanded( child: Container( child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Text( 'مشاركة', style: TextStyle( color: Colors.grey, fontWeight: FontWeight.w600, ), ), Icon( CustomIcons .arrow_curved_to_the_left_svgrepo_com, color: Colors.grey, ), ], ), ), ), Expanded( child: Container( child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Text( 'تعليق', style: TextStyle( color: Colors.grey, fontWeight: FontWeight.w600, ), ), Icon( CustomIcons.comment_svgrepo_com, color: Colors.grey, ), ], ), ), ), Expanded( child: Container( child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Text( 'أعجبنى', style: TextStyle( color: Colors.grey, fontWeight: FontWeight.w600, ), ), SizedBox( width: 10, ), Icon( CustomIcons.like_svgrepo_com, color: Colors.grey, size: 20, ), ], ), ), ), ], ), SizedBox( height: 10, ), // new item Container( color: Colors.green, width: double.infinity, height: 600, child: Image( image: NetworkImage( '${usersFour.four_post_image}', ), fit: isCovered? BoxFit.cover : BoxFit.none, ), ), SizedBox( height: 15, ), Padding( padding: const EdgeInsets.symmetric(horizontal: 15), child: Row( children: [ Text( '${usersFour.share_count}', textDirection: TextDirection.rtl, style: TextStyle( color: Colors.grey, ), ), SizedBox( width: 5, ), Text( '${usersFour.comment_count}', textDirection: TextDirection.rtl, style: TextStyle( color: Colors.grey, ), ), Expanded( child: Container( height: 20, child: Wrap( direction: Axis.horizontal, alignment: WrapAlignment.end, crossAxisAlignment: WrapCrossAlignment.center, children: [ Text( '${usersFour.like_count}', textDirection: TextDirection.rtl, style: TextStyle( color: Colors.grey, ), ), Stack( children: [ Container( width: 55, height: 20, ), PositionedDirectional( end: 0, child: Container( height: 20, width: 20, decoration: BoxDecoration( border: Border.all( color: Colors.white, width: 1.5), borderRadius: BorderRadius.circular(18)), child: SvgPicture.asset( '${usersFour.first_rect}', ), ), ), PositionedDirectional( end: 16, child: Container( height: 20, width: 20, decoration: BoxDecoration( border: Border.all( color: Colors.white, width: 1.5), borderRadius: BorderRadius.circular(18)), child: SvgPicture.asset( '${usersFour.second_rect}', ), ), ), PositionedDirectional( end: 32, child: Container( height: 20, width: 20, decoration: BoxDecoration( border: Border.all( color: Colors.white, width: 1.5), borderRadius: BorderRadius.circular(18)), child: SvgPicture.asset( '${usersFour.thirty_rect}', ), ), ), ], ), ], ), ), ), ], ), ), SizedBox( height: 15, ), Row( children: [ Expanded( child: Container( child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Text( 'مشاركة', style: TextStyle( color: Colors.grey, fontWeight: FontWeight.w600, ), ), Icon( CustomIcons .arrow_curved_to_the_left_svgrepo_com, color: Colors.grey, ), ], ), ), ), Expanded( child: Container( child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Text( 'تعليق', style: TextStyle( color: Colors.grey, fontWeight: FontWeight.w600, ), ), Icon( CustomIcons.comment_svgrepo_com, color: Colors.grey, ), ], ), ), ), Expanded( child: Container( child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Text( 'أعجبنى', style: TextStyle( color: Colors.grey, fontWeight: FontWeight.w600, ), ), SizedBox( width: 10, ), Icon( CustomIcons.like_svgrepo_com, color: Colors.grey, size: 20, ), ], ), ), ), ], ), SizedBox( height: 10, ), ]; } @override Widget build(BuildContext context) { return BlocConsumer<HomeCubit, HomeStates>( listener: (context, state) {}, builder: (context, state) { List<LocalData> users = HomeCubit.get(context).persons; List<LocalData> usersFour = HomeCubit.get(context).persons_four; List<LocalData> usersTwo = HomeCubit.get(context).person_two; List<LocalData> person_three = HomeCubit.get(context).person_three; List<LocalData> person_five = HomeCubit.get(context).person_five; return Container( color: Colors.grey[400], child: SingleChildScrollView( physics: BouncingScrollPhysics(), child: Column( children: [ SizedBox( width: double.infinity, ), Container( height: 130, width: double.infinity, color: Colors.white, child: Column( children: [ Padding( padding: const EdgeInsetsDirectional.only( top: 20, start: 10, end: 10, ), child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ Expanded( child: Container( margin: EdgeInsetsDirectional.only( top: 1.5, ), height: 38, decoration: BoxDecoration( borderRadius: BorderRadius.circular(20), border: Border.all( color: Colors.grey, width: 1.2, ), ), child: Padding( padding: const EdgeInsets.symmetric( vertical: 5, horizontal: 20, ), child: Text( 'بم تفكر؟', textAlign: TextAlign.end, style: TextStyle( fontSize: 17, fontWeight: FontWeight.w500, color: Colors.black, ), ), ), ), ), SizedBox( width: 10, ), CircleAvatar( radius: 19, backgroundColor: Colors.blue, backgroundImage: NetworkImage( '${users[0].url}', ), ), ], ), ), SizedBox( height: 15, ), Container( height: 1, width: double.infinity, color: Colors.grey, ), SizedBox( height: 15, ), Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ Expanded( child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Text( 'غرفة', style: TextStyle( fontSize: 16, ), ), Icon( Icons.video_call, color: Colors.deepPurpleAccent, size: 22, ), ], ), ), Expanded( child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Text( 'صورة', style: TextStyle( fontSize: 16, ), ), Icon( CustomIcons.gallery, color: Colors.lightGreen, size: 18, ), ], ), ), Expanded( child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Text( 'بث مباشر', style: TextStyle( fontSize: 16, ), ), Icon( Icons.missed_video_call, color: Colors.pinkAccent, size: 22, ), ], ), ), ], ), ], ), ), SizedBox( height: 15, ), Container( height: 200, color: Colors.white, width: double.infinity, padding: EdgeInsetsDirectional.only( end: 15, top: 10, bottom: 10, ), child: SingleChildScrollView( scrollDirection: Axis.horizontal, reverse: true, child: Row( children: [ ListView.builder( physics: NeverScrollableScrollPhysics(), shrinkWrap: true, reverse: true, scrollDirection: Axis.horizontal, itemCount: users.length, itemBuilder: (context, index) => Container( width: 115, height: double.infinity, child: Stack( alignment: AlignmentDirectional.bottomCenter, children: [ Card( color: Colors.white, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(10), ), clipBehavior: Clip.antiAlias, child: Column( children: [ Expanded( flex: 2, child: Container( decoration: BoxDecoration( image: DecorationImage( image: NetworkImage( '${users[index].story}'), fit: BoxFit.cover, )), ), ), ], ), ), Padding( padding: const EdgeInsets.all(10.0), child: Align( alignment: AlignmentDirectional.topEnd, child: Container( width: 40, height: 40, decoration: BoxDecoration( borderRadius: BorderRadius.circular(20), color: Colors.blue, border: Border.all( color: primaryColor, width: 2.3, ), image: DecorationImage( image: NetworkImage( '${users[index].url}', ), fit: BoxFit.cover), ), ), ), ), Padding( padding: const EdgeInsets.all(15.0), child: Text( '${users[index].name}', maxLines: 1, overflow: TextOverflow.ellipsis, style: TextStyle( color: Colors.white, fontWeight: FontWeight.w500, ), ), ), ], ), ), ), widget(), ], ), ), ), Column( children: [ ListView.separated( shrinkWrap: true, padding: const EdgeInsetsDirectional.only(top:15,), physics: NeverScrollableScrollPhysics(), itemBuilder: (_, index) { return itemPost(users[index]); }, separatorBuilder: (_, index)=> SizedBox( height: 15, ), itemCount: 2, ), // **posts contain 4 images** ListView.separated( shrinkWrap: true, padding: const EdgeInsetsDirectional.only(top:15,), physics: NeverScrollableScrollPhysics(), itemBuilder: (_, index){ return fourItemPostFun( moveToIndex: moveToIndex, itemScrollController: itemScrollController, returnWidgets: returnWidgets, users: users, usersFour: usersFour[index] ); }, separatorBuilder: (_, index) => SizedBox( height: 15, ), itemCount: 2, ), // **posts contain 2 images** ListView.separated( shrinkWrap: true, padding: const EdgeInsetsDirectional.only(top:15,), physics: NeverScrollableScrollPhysics(), itemBuilder: (_, index) => twoItemPostFun( returnWidgets: returnWidgets, itemScrollController: itemScrollController, moveToIndex: moveToIndex, person_two: usersTwo[index], ), separatorBuilder: (_, index) => SizedBox( height: 15, ), itemCount: 1, ), // **posts contain 4 images part two** ListView.separated( shrinkWrap: true, padding: const EdgeInsetsDirectional.only(top:15,), physics: NeverScrollableScrollPhysics(), itemBuilder: (_, index) => fourItemPostFun_2( returnWidgets: returnWidgets, itemScrollController: itemScrollController, moveToIndex: moveToIndex, usersFour: usersFour[index], ), separatorBuilder: (_, index) => SizedBox( height: 15, ), itemCount: 1, ), // **posts contain 3 images ** ListView.separated( shrinkWrap: true, padding: const EdgeInsetsDirectional.only(top:15,), physics: NeverScrollableScrollPhysics(), itemBuilder: (_, index) => threeItemPostFun( returnWidgets: returnWidgets, itemScrollController: itemScrollController, moveToIndex: moveToIndex, usersThree: person_three[index], ), separatorBuilder: (_, index) => SizedBox( height: 15, ), itemCount: 1, ), // **posts contain 5 images ** ListView.separated( shrinkWrap: true, padding: const EdgeInsetsDirectional.only(top:15,), physics: NeverScrollableScrollPhysics(), itemBuilder: (_, index) => fiveItemPostFun( returnWidgets: returnWidgets, itemScrollController: itemScrollController, moveToIndex: moveToIndex, usersFive: person_five[index], ), separatorBuilder: (_, index) => SizedBox( height: 15, ), itemCount: 1, ), ], ), ], ), ), ); }, ); } } Widget widget() => Container( width: 115, height: double.infinity, child: Stack( alignment: AlignmentDirectional.bottomCenter, children: [ Card( color: Colors.white, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(10), ), clipBehavior: Clip.antiAlias, child: Column( children: [ Expanded( flex: 2, child: Container( decoration: BoxDecoration( image: DecorationImage( image: NetworkImage( 'https://serving.photos.photobox.com/25235201d5280a9882ac9a90e30d287c527be9a7e648e6b3207215203329d3271a4fb63b.jpg'), fit: BoxFit.cover, )), ), ), Expanded( child: Align( alignment: AlignmentDirectional.bottomCenter, child: Padding( padding: const EdgeInsets.all(3.0), child: Text( 'إنشاء قصة', style: TextStyle( fontWeight: FontWeight.w500, ), ), ), ), ), ], ), ), PositionedDirectional( top: Percent.widgetVerticalPosition( ratio: 60, heightChild: 40, heightParent: 200, ), start: Percent.widgetHorizontalPosition( ratio: 50, widthChild: 40, widthParent: 115, ), child: Container( width: 40, height: 40, decoration: BoxDecoration( borderRadius: BorderRadius.circular(20), color: Colors.blue, border: Border.all( color: Colors.white, width: 2.3, ), ), child: Icon( Icons.add, color: Colors.white, size: 30, ), ), ), ], ), ); /** * posts of type */ // this widget contains [one] image Widget itemPost(LocalData users ) => Container( color: Colors.white, child: Wrap( alignment: WrapAlignment.end, children: [ Container( padding: EdgeInsetsDirectional.only(end: 15.0,top: 10), child: Column( crossAxisAlignment: CrossAxisAlignment.end, children: [ Row( children: [ IconButton( padding: EdgeInsetsDirectional.zero, onPressed: () {}, icon: Icon( Icons.more_horiz_rounded, color: Colors.grey[700], ), ), Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.end, mainAxisSize: MainAxisSize.min, children: [ Text( '${users.name}', textAlign: TextAlign.end, style: TextStyle( fontWeight: FontWeight.bold, ), ), Row( mainAxisAlignment: MainAxisAlignment.end, children: [ Padding( padding: const EdgeInsets.symmetric(horizontal: 8.0), child: Icon( Icons.public_rounded, color: Colors.grey[700], size: 16, ), ), Text( '${users.date}', textAlign: TextAlign.end, style: TextStyle( fontSize: 12, ), ), ], ), ], ), ), Padding( padding: const EdgeInsetsDirectional.only(start: 15), child: Align( alignment: AlignmentDirectional.topEnd, child: Container( width: 40, height: 40, decoration: BoxDecoration( borderRadius: BorderRadius.circular(20), color: Colors.blue, border: Border.all( color: primaryColor, width: 2.3, ), image: DecorationImage( image: NetworkImage( '${users.url}', ), fit: BoxFit.cover), ), ), ), ), ], ), Text( '${users.post??''}', textDirection: TextDirection.rtl, style: TextStyle( fontWeight: FontWeight.w500, fontSize: 14, ), ), ], ), ), OpenContainer( transitionType: ContainerTransitionType.fadeThrough, transitionDuration: Duration(seconds: 1), openBuilder: (BuildContext context, void Function({Object? returnValue}) action) { return Container( color: Colors.black, child: Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment:CrossAxisAlignment.end, children: [ Expanded( child: Column( mainAxisAlignment: MainAxisAlignment.end, children: [ Image( image: NetworkImage( '${users.post_image}', ), ), ], ), ), Padding( padding: const EdgeInsets.symmetric(horizontal: 5), child: Column( crossAxisAlignment:CrossAxisAlignment.end, children: [ SizedBox( height: 20, ), Text( '${users.post}', textDirection: TextDirection.rtl, style: TextStyle( fontWeight: FontWeight.w500, fontSize: 14, color: Colors.white, ), ), SizedBox( height: 20, ), Text( '${users.date}', textDirection: TextDirection.rtl, style: TextStyle( fontWeight: FontWeight.w500, fontSize: 12, color: Colors.white, ), ), SizedBox( height: 10, ), Row( children: [ Text( '${users.share_count}', textDirection: TextDirection.rtl, style: TextStyle( color: Colors.white, ), ), SizedBox( width: 5, ), Text( '${users.comment_count}', textDirection: TextDirection.rtl, style: TextStyle( color: Colors.white, ), ), Expanded( child: Container( height: 20, child: Wrap( direction: Axis.horizontal, alignment: WrapAlignment.end, crossAxisAlignment: WrapCrossAlignment.center, children: [ Text( '${users.like_count}', textDirection: TextDirection.rtl, style: TextStyle( color: Colors.white, ), ), Stack( children: [ Container( width: 55, height: 20, ), PositionedDirectional( end: 0, child: Container( height: 20, width: 20, decoration: BoxDecoration( border: Border.all( color: Colors.white, width: 1.5), borderRadius: BorderRadius.circular(18)), child: SvgPicture.asset( '${users.first_rect}', ), ), ), PositionedDirectional( end: 16, child: Container( height: 20, width: 20, decoration: BoxDecoration( border: Border.all( color: Colors.white, width: 1.5), borderRadius: BorderRadius.circular(18)), child: SvgPicture.asset( '${users.second_rect}', ), ), ), PositionedDirectional( end: 32, child: Container( height: 20, width: 20, decoration: BoxDecoration( border: Border.all( color: Colors.white, width: 1.5), borderRadius: BorderRadius.circular(18)), child: SvgPicture.asset( '${users.thirty_rect}', ), ), ), ], ), ], ), ), ), ], ), SizedBox( height: 10, ), Container( width: double.infinity, height: 1, color: Colors.grey, ), SizedBox( height: 15, ), Row( children: [ Expanded( child: Container( child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Text( 'مشاركة', style: TextStyle( color: Colors.white, fontWeight: FontWeight.w600, ), ), Icon( CustomIcons .arrow_curved_to_the_left_svgrepo_com, color: Colors.white, ), ], ), ), ), Expanded( child: Container( child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Text( 'تعليق', style: TextStyle( color: Colors.white, fontWeight: FontWeight.w600, ), ), Icon( CustomIcons.comment_svgrepo_com, color: Colors.white, ), ], ), ), ), Expanded( child: Container( child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Text( 'أعجبنى', style: TextStyle( color: Colors.white, fontWeight: FontWeight.w600, ), ), SizedBox( width: 10, ), Icon( CustomIcons.like_svgrepo_com, color: Colors.white, size: 20, ), ], ), ), ), ], ), SizedBox( height: 10, ), ], ), ), ], ), ); }, closedBuilder: (BuildContext context, void Function() action) { return Padding( padding: const EdgeInsetsDirectional.only(top: 10), child: Image( image: NetworkImage( '${users.post_image}', ), ), ); }, ), Padding( padding: const EdgeInsets.all(12.0), child: Container( width: double.infinity, child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Row( children: [ Text( '${users.share_count}', textDirection: TextDirection.rtl, style: TextStyle( color: Colors.grey, ), ), SizedBox( width: 5, ), Text( '${users.comment_count}', textDirection: TextDirection.rtl, style: TextStyle( color: Colors.grey, ), ), Expanded( child: Container( height: 20, child: Wrap( direction: Axis.horizontal, alignment: WrapAlignment.end, crossAxisAlignment: WrapCrossAlignment.center, children: [ Text( '${users.like_count}', textDirection: TextDirection.rtl, style: TextStyle( color: Colors.grey, ), ), Stack( children: [ Container( width: 55, height: 20, ), PositionedDirectional( end: 0, child: Container( height: 20, width: 20, decoration: BoxDecoration( border: Border.all( color: Colors.white, width: 1.5), borderRadius: BorderRadius.circular(18)), child: SvgPicture.asset( '${users.first_rect}', ), ), ), PositionedDirectional( end: 16, child: Container( height: 20, width: 20, decoration: BoxDecoration( border: Border.all( color: Colors.white, width: 1.5), borderRadius: BorderRadius.circular(18)), child: SvgPicture.asset( '${users.second_rect}', ), ), ), PositionedDirectional( end: 32, child: Container( height: 20, width: 20, decoration: BoxDecoration( border: Border.all( color: Colors.white, width: 1.5), borderRadius: BorderRadius.circular(18)), child: SvgPicture.asset( '${users.thirty_rect}', ), ), ), ], ), ], ), ), ), ], ), SizedBox( height: 15, ), Row( children: [ Expanded( child: Container( child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Text( 'مشاركة', style: TextStyle( color: Colors.grey, fontWeight: FontWeight.w600, ), ), Icon( CustomIcons .arrow_curved_to_the_left_svgrepo_com, color: Colors.grey, ), ], ), ), ), Expanded( child: Container( child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Text( 'تعليق', style: TextStyle( color: Colors.grey, fontWeight: FontWeight.w600, ), ), Icon( CustomIcons.comment_svgrepo_com, color: Colors.grey, ), ], ), ), ), Expanded( child: Container( child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Text( 'أعجبنى', style: TextStyle( color: Colors.grey, fontWeight: FontWeight.w600, ), ), SizedBox( width: 10, ), Icon( CustomIcons.like_svgrepo_com, color: Colors.grey, size: 20, ), ], ), ), ), ], ), ], ), ), ), ], ), ); // this widget contains [two] image Widget twoItemPostFun({ required LocalData person_two, required moveToIndex, required itemScrollController, required returnWidgets, }) { List<Widget> selectItem = returnWidgets( isCovered: true, usersFour: person_two, ); return Container( color: Colors.white, child: Wrap( alignment: WrapAlignment.end, children: [ Container( padding: EdgeInsetsDirectional.only(end: 15.0,top: 10), child: Column( crossAxisAlignment: CrossAxisAlignment.end, children: [ Row( children: [ IconButton( padding: EdgeInsetsDirectional.zero, onPressed: () {}, icon: Icon( Icons.more_horiz_rounded, color: Colors.grey[700], ), ), Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.end, mainAxisSize: MainAxisSize.min, children: [ Text( '${person_two.name}', textAlign: TextAlign.end, style: TextStyle( fontWeight: FontWeight.bold, ), ), Row( mainAxisAlignment: MainAxisAlignment.end, children: [ Padding( padding: const EdgeInsets.symmetric(horizontal: 8.0), child: Icon( Icons.public_rounded, color: Colors.grey[700], size: 16, ), ), Text( '${person_two.date}', textAlign: TextAlign.end, style: TextStyle( fontSize: 12, ), ), ], ), ], ), ), Padding( padding: const EdgeInsetsDirectional.only(start: 15), child: Align( alignment: AlignmentDirectional.topEnd, child: Container( width: 40, height: 40, decoration: BoxDecoration( borderRadius: BorderRadius.circular(20), color: Colors.blue, border: Border.all( color: primaryColor, width: 2.3, ), image: DecorationImage( image: NetworkImage( '${person_two.url}', ), fit: BoxFit.cover), ), ), ), ), ], ), Text( '${person_two.post??''}', textDirection: TextDirection.rtl, style: TextStyle( fontWeight: FontWeight.w500, fontSize: 14, ), ), ], ), ), Container( height: 350, width: double.infinity, child: Column( children: [ Expanded( child: OpenContainer( transitionDuration: Duration(seconds: 1), transitionType: ContainerTransitionType.fadeThrough, openBuilder: (BuildContext context, void Function({Object? returnValue}) action) { moveToIndex(0).catchError((onError){}); return Container( color: Colors.white, child: SafeArea( child: Padding( padding: const EdgeInsetsDirectional.only(top: 10), child: ScrollablePositionedList.builder( scrollDirection: Axis.vertical, itemCount: 17, itemScrollController: itemScrollController, itemBuilder: (context , index){ return selectItem[index]; }, ), ), ), ); }, closedBuilder: (BuildContext context, void Function() action) { return selectItem[6]; }, ), ), SizedBox( height: 3, ), Expanded( child: OpenContainer( transitionDuration: Duration(seconds: 1), transitionType: ContainerTransitionType.fadeThrough, openBuilder: (BuildContext context, void Function({Object? returnValue}) action) { moveToIndex(7).catchError((onError){}); return Container( color: Colors.white, child: SafeArea( child: Padding( padding: const EdgeInsetsDirectional.only(top: 10), child: ScrollablePositionedList.builder( scrollDirection: Axis.vertical, itemCount: 17, itemScrollController: itemScrollController, itemBuilder: (context , index){ return selectItem[index]; }, ), ), ), ); }, closedBuilder: (BuildContext context, void Function() action) { return selectItem[12]; }, ), ), ], ), ), Padding( padding: const EdgeInsets.all(12.0), child: Container( width: double.infinity, child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Row( children: [ Text( '${person_two.share_count}', textDirection: TextDirection.rtl, style: TextStyle( color: Colors.grey, ), ), SizedBox( width: 5, ), Text( '${person_two.comment_count}', textDirection: TextDirection.rtl, style: TextStyle( color: Colors.grey, ), ), Expanded( child: Container( height: 20, child: Wrap( direction: Axis.horizontal, alignment: WrapAlignment.end, crossAxisAlignment: WrapCrossAlignment.center, children: [ Text( '${person_two.like_count}', textDirection: TextDirection.rtl, style: TextStyle( color: Colors.grey, ), ), Stack( children: [ Container( width: 55, height: 20, ), PositionedDirectional( end: 0, child: Container( height: 20, width: 20, decoration: BoxDecoration( border: Border.all( color: Colors.white, width: 1.5), borderRadius: BorderRadius.circular(18)), child: SvgPicture.asset( '${person_two.first_rect}', ), ), ), PositionedDirectional( end: 16, child: Container( height: 20, width: 20, decoration: BoxDecoration( border: Border.all( color: Colors.white, width: 1.5), borderRadius: BorderRadius.circular(18)), child: SvgPicture.asset( '${person_two.second_rect}', ), ), ), PositionedDirectional( end: 32, child: Container( height: 20, width: 20, decoration: BoxDecoration( border: Border.all( color: Colors.white, width: 1.5), borderRadius: BorderRadius.circular(18)), child: SvgPicture.asset( '${person_two.thirty_rect}', ), ), ), ], ), ], ), ), ), ], ), SizedBox( height: 15, ), Row( children: [ Expanded( child: Container( child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Text( 'مشاركة', style: TextStyle( color: Colors.grey, fontWeight: FontWeight.w600, ), ), Icon( CustomIcons .arrow_curved_to_the_left_svgrepo_com, color: Colors.grey, ), ], ), ), ), Expanded( child: Container( child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Text( 'تعليق', style: TextStyle( color: Colors.grey, fontWeight: FontWeight.w600, ), ), Icon( CustomIcons.comment_svgrepo_com, color: Colors.grey, ), ], ), ), ), Expanded( child: Container( child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Text( 'أعجبنى', style: TextStyle( color: Colors.grey, fontWeight: FontWeight.w600, ), ), SizedBox( width: 10, ), Icon( CustomIcons.like_svgrepo_com, color: Colors.grey, size: 20, ), ], ), ), ), ], ), ], ), ), ), ], ), ); } // this widget contains [three] image Widget threeItemPostFun({ required moveToIndex, required itemScrollController, required LocalData usersThree, required returnWidgets, }) { List<Widget> selectItem = returnWidgets( isCovered: true, usersFour: usersThree, ); return Container( color: Colors.white, child: Wrap( alignment: WrapAlignment.end, children: [ Container( padding: EdgeInsetsDirectional.only(end: 15.0,top: 10), child: Column( crossAxisAlignment: CrossAxisAlignment.end, children: [ Row( children: [ IconButton( padding: EdgeInsetsDirectional.zero, onPressed: () {}, icon: Icon( Icons.more_horiz_rounded, color: Colors.grey[700], ), ), Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.end, mainAxisSize: MainAxisSize.min, children: [ Text( '${usersThree.name}', textAlign: TextAlign.end, style: TextStyle( fontWeight: FontWeight.bold, ), ), Row( mainAxisAlignment: MainAxisAlignment.end, children: [ Padding( padding: const EdgeInsets.symmetric(horizontal: 8.0), child: Icon( Icons.public_rounded, color: Colors.grey[700], size: 16, ), ), Text( '${usersThree.date}', textAlign: TextAlign.end, style: TextStyle( fontSize: 12, ), ), ], ), ], ), ), Padding( padding: const EdgeInsetsDirectional.only(start: 15), child: Align( alignment: AlignmentDirectional.topEnd, child: Container( width: 40, height: 40, decoration: BoxDecoration( borderRadius: BorderRadius.circular(20), color: Colors.blue, border: Border.all( color: primaryColor, width: 2.3, ), image: DecorationImage( image: NetworkImage( '${usersThree.url}', ), fit: BoxFit.cover), ), ), ), ), ], ), Text( '${usersThree.post??''}', textDirection: TextDirection.rtl, style: TextStyle( fontWeight: FontWeight.w500, fontSize: 14, ), ), ], ), ), Container( height: 350, width: double.infinity, child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ Expanded( flex: 2, child: OpenContainer( transitionDuration: Duration(seconds: 1), transitionType: ContainerTransitionType.fadeThrough, openBuilder: (BuildContext context, void Function({Object? returnValue}) action) { moveToIndex(0).catchError((onError){}); return Container( color: Colors.white, child: SafeArea( child: Padding( padding: const EdgeInsetsDirectional.only(top: 10), child: ScrollablePositionedList.builder( scrollDirection: Axis.vertical, itemCount: 24, itemScrollController: itemScrollController, itemBuilder: (context , index){ return selectItem[index]; }, ), ), ), ); }, closedBuilder: (BuildContext context, void Function() action) { return selectItem[6]; }, ), ), SizedBox( width: 3, ), Expanded( flex: 1, child: Column( children: [ Expanded( flex: 1, child: OpenContainer( transitionDuration: Duration(seconds: 1), transitionType: ContainerTransitionType.fadeThrough, openBuilder: (BuildContext context, void Function({Object? returnValue}) action) { moveToIndex(7).catchError((onError){}); return Container( color: Colors.white, child: SafeArea( child: Padding( padding: const EdgeInsetsDirectional.only(top: 10), child: ScrollablePositionedList.builder( scrollDirection: Axis.vertical, itemCount: 24, itemScrollController: itemScrollController, itemBuilder: (context , index){ return selectItem[index]; }, ), ), ), ); }, closedBuilder: (BuildContext context, void Function() action) { return selectItem[12]; }, ), ), SizedBox( height: 3, ), Expanded( flex: 1, child: OpenContainer( transitionDuration: Duration(seconds: 1), transitionType: ContainerTransitionType.fadeThrough, openBuilder: (BuildContext context, void Function({Object? returnValue}) action) { moveToIndex(13).catchError((onError){}); return Container( color: Colors.white, child: SafeArea( child: Padding( padding: const EdgeInsetsDirectional.only(top: 10), child: ScrollablePositionedList.builder( scrollDirection: Axis.vertical, itemCount: 24, itemScrollController: itemScrollController, itemBuilder: (context , index){ return selectItem[index]; }, ), ), ), ); }, closedBuilder: (BuildContext context, void Function() action) { return selectItem[18]; }, ), ), ], ), ), ], ), ), Padding( padding: const EdgeInsets.all(12.0), child: Container( width: double.infinity, child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Row( children: [ Text( '${usersThree.share_count}', textDirection: TextDirection.rtl, style: TextStyle( color: Colors.grey, ), ), SizedBox( width: 5, ), Text( '${usersThree.comment_count}', textDirection: TextDirection.rtl, style: TextStyle( color: Colors.grey, ), ), Expanded( child: Container( height: 20, child: Wrap( direction: Axis.horizontal, alignment: WrapAlignment.end, crossAxisAlignment: WrapCrossAlignment.center, children: [ Text( '${usersThree.like_count}', textDirection: TextDirection.rtl, style: TextStyle( color: Colors.grey, ), ), Stack( children: [ Container( width: 55, height: 20, ), PositionedDirectional( end: 0, child: Container( height: 20, width: 20, decoration: BoxDecoration( border: Border.all( color: Colors.white, width: 1.5), borderRadius: BorderRadius.circular(18)), child: SvgPicture.asset( '${usersThree.first_rect}', ), ), ), PositionedDirectional( end: 16, child: Container( height: 20, width: 20, decoration: BoxDecoration( border: Border.all( color: Colors.white, width: 1.5), borderRadius: BorderRadius.circular(18)), child: SvgPicture.asset( '${usersThree.second_rect}', ), ), ), PositionedDirectional( end: 32, child: Container( height: 20, width: 20, decoration: BoxDecoration( border: Border.all( color: Colors.white, width: 1.5), borderRadius: BorderRadius.circular(18)), child: SvgPicture.asset( '${usersThree.thirty_rect}', ), ), ), ], ), ], ), ), ), ], ), SizedBox( height: 15, ), Row( children: [ Expanded( child: Container( child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Text( 'مشاركة', style: TextStyle( color: Colors.grey, fontWeight: FontWeight.w600, ), ), Icon( CustomIcons .arrow_curved_to_the_left_svgrepo_com, color: Colors.grey, ), ], ), ), ), Expanded( child: Container( child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Text( 'تعليق', style: TextStyle( color: Colors.grey, fontWeight: FontWeight.w600, ), ), Icon( CustomIcons.comment_svgrepo_com, color: Colors.grey, ), ], ), ), ), Expanded( child: Container( child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Text( 'أعجبنى', style: TextStyle( color: Colors.grey, fontWeight: FontWeight.w600, ), ), SizedBox( width: 10, ), Icon( CustomIcons.like_svgrepo_com, color: Colors.grey, size: 20, ), ], ), ), ), ], ), ], ), ), ), ], ), ); } // this widget contains [four_1] image Widget fourItemPostFun({ required users, required moveToIndex, required itemScrollController, required LocalData usersFour, required returnWidgets, }){ List<Widget> selectItem = returnWidgets( isCovered: true, usersFour: usersFour, ); return Container( color: Colors.white, child: Wrap( alignment: WrapAlignment.end, children: [ Container( padding: EdgeInsetsDirectional.only(end: 15.0,top: 10), child: Column( crossAxisAlignment: CrossAxisAlignment.end, children: [ Row( children: [ IconButton( padding: EdgeInsetsDirectional.zero, onPressed: () {}, icon: Icon( Icons.more_horiz_rounded, color: Colors.grey[700], ), ), Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.end, mainAxisSize: MainAxisSize.min, children: [ Text( '${usersFour.name}', textAlign: TextAlign.end, style: TextStyle( fontWeight: FontWeight.bold, ), ), Row( mainAxisAlignment: MainAxisAlignment.end, children: [ Padding( padding: const EdgeInsets.symmetric(horizontal: 8.0), child: Icon( Icons.public_rounded, color: Colors.grey[700], size: 16, ), ), Text( '${usersFour.date}', textAlign: TextAlign.end, style: TextStyle( fontSize: 12, ), ), ], ), ], ), ), Padding( padding: const EdgeInsetsDirectional.only(start: 15), child: Align( alignment: AlignmentDirectional.topEnd, child: Container( width: 40, height: 40, decoration: BoxDecoration( borderRadius: BorderRadius.circular(20), color: Colors.blue, border: Border.all( color: primaryColor, width: 2.3, ), image: DecorationImage( image: NetworkImage( '${usersFour.url}', ), fit: BoxFit.cover), ), ), ), ), ], ), Text( '${usersFour.post??''}', textDirection: TextDirection.rtl, style: TextStyle( fontWeight: FontWeight.w500, fontSize: 14, ), ), ], ), ), Container( height: 350, width: double.infinity, child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ Expanded( flex: 2, child: OpenContainer( transitionDuration: Duration(seconds: 1), transitionType: ContainerTransitionType.fadeThrough, openBuilder: (BuildContext context, void Function({Object? returnValue}) action) { moveToIndex(0).catchError((onError){}); return Container( color: Colors.white, child: SafeArea( child: Padding( padding: const EdgeInsetsDirectional.only(top: 10), child: ScrollablePositionedList.builder( scrollDirection: Axis.vertical, itemCount: 29, itemScrollController: itemScrollController, itemBuilder: (context , index){ return selectItem[index]; }, ), ), ), ); }, closedBuilder: (BuildContext context, void Function() action) { return selectItem[6]; }, ), ), SizedBox( width: 3, ), Expanded( flex: 1, child: Column( children: [ Expanded( flex: 1, child: OpenContainer( transitionDuration: Duration(seconds: 1), transitionType: ContainerTransitionType.fadeThrough, openBuilder: (BuildContext context, void Function({Object? returnValue}) action) { moveToIndex(7).catchError((onError){}); return Container( color: Colors.white, child: SafeArea( child: Padding( padding: const EdgeInsetsDirectional.only(top: 10), child: ScrollablePositionedList.builder( scrollDirection: Axis.vertical, itemCount: 29, itemScrollController: itemScrollController, itemBuilder: (context , index){ return selectItem[index]; }, ), ), ), ); }, closedBuilder: (BuildContext context, void Function() action) { return selectItem[12]; }, ), ), SizedBox( height: 3, ), Expanded( flex: 1, child: OpenContainer( transitionDuration: Duration(seconds: 1), transitionType: ContainerTransitionType.fadeThrough, openBuilder: (BuildContext context, void Function({Object? returnValue}) action) { moveToIndex(13).catchError((onError){}); return Container( color: Colors.white, child: SafeArea( child: Padding( padding: const EdgeInsetsDirectional.only(top: 10), child: ScrollablePositionedList.builder( scrollDirection: Axis.vertical, itemCount: 29, itemScrollController: itemScrollController, itemBuilder: (context , index){ return selectItem[index]; }, ), ), ), ); }, closedBuilder: (BuildContext context, void Function() action) { return selectItem[18]; }, ), ), SizedBox( height: 3, ), Expanded( flex: 1, child: OpenContainer( transitionDuration: Duration(seconds: 1), transitionType: ContainerTransitionType.fadeThrough, openBuilder: (BuildContext context, void Function({Object? returnValue}) action) { moveToIndex(19).catchError((onError){}); return Container( color: Colors.white, child: SafeArea( child: Padding( padding: const EdgeInsetsDirectional.only(top: 10), child: ScrollablePositionedList.builder( scrollDirection: Axis.vertical, itemCount: 29, itemScrollController: itemScrollController, itemBuilder: (context , index){ return selectItem[index]; }, ), ), ), ); }, closedBuilder: (BuildContext context, void Function() action) { return selectItem[24]; }, ), ), ], ), ), ], ), ), Padding( padding: const EdgeInsets.all(12.0), child: Container( width: double.infinity, child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Row( children: [ Text( '${usersFour.share_count}', textDirection: TextDirection.rtl, style: TextStyle( color: Colors.grey, ), ), SizedBox( width: 5, ), Text( '${usersFour.comment_count}', textDirection: TextDirection.rtl, style: TextStyle( color: Colors.grey, ), ), Expanded( child: Container( height: 20, child: Wrap( direction: Axis.horizontal, alignment: WrapAlignment.end, crossAxisAlignment: WrapCrossAlignment.center, children: [ Text( '${usersFour.like_count}', textDirection: TextDirection.rtl, style: TextStyle( color: Colors.grey, ), ), Stack( children: [ Container( width: 55, height: 20, ), PositionedDirectional( end: 0, child: Container( height: 20, width: 20, decoration: BoxDecoration( border: Border.all( color: Colors.white, width: 1.5), borderRadius: BorderRadius.circular(18)), child: SvgPicture.asset( '${usersFour.first_rect}', ), ), ), PositionedDirectional( end: 16, child: Container( height: 20, width: 20, decoration: BoxDecoration( border: Border.all( color: Colors.white, width: 1.5), borderRadius: BorderRadius.circular(18)), child: SvgPicture.asset( '${usersFour.second_rect}', ), ), ), PositionedDirectional( end: 32, child: Container( height: 20, width: 20, decoration: BoxDecoration( border: Border.all( color: Colors.white, width: 1.5), borderRadius: BorderRadius.circular(18)), child: SvgPicture.asset( '${usersFour.thirty_rect}', ), ), ), ], ), ], ), ), ), ], ), SizedBox( height: 15, ), Row( children: [ Expanded( child: Container( child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Text( 'مشاركة', style: TextStyle( color: Colors.grey, fontWeight: FontWeight.w600, ), ), Icon( CustomIcons .arrow_curved_to_the_left_svgrepo_com, color: Colors.grey, ), ], ), ), ), Expanded( child: Container( child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Text( 'تعليق', style: TextStyle( color: Colors.grey, fontWeight: FontWeight.w600, ), ), Icon( CustomIcons.comment_svgrepo_com, color: Colors.grey, ), ], ), ), ), Expanded( child: Container( child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Text( 'أعجبنى', style: TextStyle( color: Colors.grey, fontWeight: FontWeight.w600, ), ), SizedBox( width: 10, ), Icon( CustomIcons.like_svgrepo_com, color: Colors.grey, size: 20, ), ], ), ), ), ], ), ], ), ), ), ], ), ); } // this widget contains [four_2] image Widget fourItemPostFun_2({ required LocalData usersFour, required moveToIndex, required itemScrollController, required returnWidgets, }){ List<Widget> selectItem = returnWidgets( isCovered: true, usersFour: usersFour, ); return Container( color: Colors.white, child: Wrap( alignment: WrapAlignment.end, children: [ Container( padding: EdgeInsetsDirectional.only(end: 15.0,top: 10), child: Column( crossAxisAlignment: CrossAxisAlignment.end, children: [ Row( children: [ IconButton( padding: EdgeInsetsDirectional.zero, onPressed: () {}, icon: Icon( Icons.more_horiz_rounded, color: Colors.grey[700], ), ), Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.end, mainAxisSize: MainAxisSize.min, children: [ Text( '${usersFour.name}', textAlign: TextAlign.end, style: TextStyle( fontWeight: FontWeight.bold, ), ), Row( mainAxisAlignment: MainAxisAlignment.end, children: [ Padding( padding: const EdgeInsets.symmetric(horizontal: 8.0), child: Icon( Icons.public_rounded, color: Colors.grey[700], size: 16, ), ), Text( '${usersFour.date}', textAlign: TextAlign.end, style: TextStyle( fontSize: 12, ), ), ], ), ], ), ), Padding( padding: const EdgeInsetsDirectional.only(start: 15), child: Align( alignment: AlignmentDirectional.topEnd, child: Container( width: 40, height: 40, decoration: BoxDecoration( borderRadius: BorderRadius.circular(20), color: Colors.blue, border: Border.all( color: primaryColor, width: 2.3, ), image: DecorationImage( image: NetworkImage( '${usersFour.url}', ), fit: BoxFit.cover), ), ), ), ), ], ), Text( '${usersFour.post??''}', textDirection: TextDirection.rtl, style: TextStyle( fontWeight: FontWeight.w500, fontSize: 14, ), ), ], ), ), Container( height: 350, width: double.infinity, child: Column( children: [ Expanded( child: Container( child: Row( children: [ Expanded( child: OpenContainer( transitionDuration: Duration(seconds: 1), transitionType: ContainerTransitionType.fadeThrough, openBuilder: (BuildContext context, void Function({Object? returnValue}) action) { moveToIndex(0).catchError((onError){}); return Container( color: Colors.white, child: SafeArea( child: Padding( padding: const EdgeInsetsDirectional.only(top: 10), child: ScrollablePositionedList.builder( scrollDirection: Axis.vertical, itemCount: 29, itemScrollController: itemScrollController, itemBuilder: (context , index){ return selectItem[index]; }, ), ), ), ); }, closedBuilder: (BuildContext context, void Function() action) { return selectItem[6]; }, ), ), SizedBox( width: 3, ), Expanded( child: OpenContainer( transitionDuration: Duration(seconds: 1), transitionType: ContainerTransitionType.fadeThrough, openBuilder: (BuildContext context, void Function({Object? returnValue}) action) { moveToIndex(7).catchError((onError){}); return Container( color: Colors.white, child: SafeArea( child: Padding( padding: const EdgeInsetsDirectional.only(top: 10), child: ScrollablePositionedList.builder( scrollDirection: Axis.vertical, itemCount: 29, itemScrollController: itemScrollController, itemBuilder: (context , index){ return selectItem[index]; }, ), ), ), ); }, closedBuilder: (BuildContext context, void Function() action) { return selectItem[12]; }, ), ), ], ), ), ), SizedBox( height: 3, ), Expanded( child: Container( child: Row( children: [ Expanded( child: OpenContainer( transitionDuration: Duration(seconds: 1), transitionType: ContainerTransitionType.fadeThrough, openBuilder: (BuildContext context, void Function({Object? returnValue}) action) { moveToIndex(13).catchError((onError){}); return Container( color: Colors.white, child: SafeArea( child: Padding( padding: const EdgeInsetsDirectional.only(top: 10), child: ScrollablePositionedList.builder( scrollDirection: Axis.vertical, itemCount: 29, itemScrollController: itemScrollController, itemBuilder: (context , index){ return selectItem[index]; }, ), ), ), ); }, closedBuilder: (BuildContext context, void Function() action) { return selectItem[18]; }, ), ), SizedBox( width: 3, ), Expanded( child: OpenContainer( transitionDuration: Duration(seconds: 1), transitionType: ContainerTransitionType.fadeThrough, openBuilder: (BuildContext context, void Function({Object? returnValue}) action) { moveToIndex(19).catchError((onError){}); return Container( color: Colors.white, child: SafeArea( child: Padding( padding: const EdgeInsetsDirectional.only(top: 10), child: ScrollablePositionedList.builder( scrollDirection: Axis.vertical, itemCount: 29, itemScrollController: itemScrollController, itemBuilder: (context , index){ return selectItem[index]; }, ), ), ), ); }, closedBuilder: (BuildContext context, void Function() action) { return selectItem[24]; }, ), ), ], ), ), ), ], ), ), Padding( padding: const EdgeInsets.all(12.0), child: Container( width: double.infinity, child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Row( children: [ Text( '${usersFour.share_count}', textDirection: TextDirection.rtl, style: TextStyle( color: Colors.grey, ), ), SizedBox( width: 5, ), Text( '${usersFour.comment_count}', textDirection: TextDirection.rtl, style: TextStyle( color: Colors.grey, ), ), Expanded( child: Container( height: 20, child: Wrap( direction: Axis.horizontal, alignment: WrapAlignment.end, crossAxisAlignment: WrapCrossAlignment.center, children: [ Text( '${usersFour.like_count}', textDirection: TextDirection.rtl, style: TextStyle( color: Colors.grey, ), ), Stack( children: [ Container( width: 55, height: 20, ), PositionedDirectional( end: 0, child: Container( height: 20, width: 20, decoration: BoxDecoration( border: Border.all( color: Colors.white, width: 1.5), borderRadius: BorderRadius.circular(18)), child: SvgPicture.asset( '${usersFour.first_rect}', ), ), ), PositionedDirectional( end: 16, child: Container( height: 20, width: 20, decoration: BoxDecoration( border: Border.all( color: Colors.white, width: 1.5), borderRadius: BorderRadius.circular(18)), child: SvgPicture.asset( '${usersFour.second_rect}', ), ), ), PositionedDirectional( end: 32, child: Container( height: 20, width: 20, decoration: BoxDecoration( border: Border.all( color: Colors.white, width: 1.5), borderRadius: BorderRadius.circular(18)), child: SvgPicture.asset( '${usersFour.thirty_rect}', ), ), ), ], ), ], ), ), ), ], ), SizedBox( height: 15, ), Row( children: [ Expanded( child: Container( child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Text( 'مشاركة', style: TextStyle( color: Colors.grey, fontWeight: FontWeight.w600, ), ), Icon( CustomIcons .arrow_curved_to_the_left_svgrepo_com, color: Colors.grey, ), ], ), ), ), Expanded( child: Container( child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Text( 'تعليق', style: TextStyle( color: Colors.grey, fontWeight: FontWeight.w600, ), ), Icon( CustomIcons.comment_svgrepo_com, color: Colors.grey, ), ], ), ), ), Expanded( child: Container( child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Text( 'أعجبنى', style: TextStyle( color: Colors.grey, fontWeight: FontWeight.w600, ), ), SizedBox( width: 10, ), Icon( CustomIcons.like_svgrepo_com, color: Colors.grey, size: 20, ), ], ), ), ), ], ), ], ), ), ), ], ), ); } // this widget contains [five] image Widget fiveItemPostFun({ required LocalData usersFive, required moveToIndex, required itemScrollController, required returnWidgets, }){ List<Widget> selectItem = returnWidgets( isCovered: true, usersFour: usersFive, ); return Container( color: Colors.white, child: Wrap( alignment: WrapAlignment.end, children: [ Container( padding: EdgeInsetsDirectional.only(end: 15.0,top: 10), child: Column( crossAxisAlignment: CrossAxisAlignment.end, children: [ Row( children: [ IconButton( padding: EdgeInsetsDirectional.zero, onPressed: () {}, icon: Icon( Icons.more_horiz_rounded, color: Colors.grey[700], ), ), Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.end, mainAxisSize: MainAxisSize.min, children: [ Text( '${usersFive.name}', textAlign: TextAlign.end, style: TextStyle( fontWeight: FontWeight.bold, ), ), Row( mainAxisAlignment: MainAxisAlignment.end, children: [ Padding( padding: const EdgeInsets.symmetric(horizontal: 8.0), child: Icon( Icons.public_rounded, color: Colors.grey[700], size: 16, ), ), Text( '${usersFive.date}', textAlign: TextAlign.end, style: TextStyle( fontSize: 12, ), ), ], ), ], ), ), Padding( padding: const EdgeInsetsDirectional.only(start: 15), child: Align( alignment: AlignmentDirectional.topEnd, child: Container( width: 40, height: 40, decoration: BoxDecoration( borderRadius: BorderRadius.circular(20), color: Colors.blue, border: Border.all( color: primaryColor, width: 2.3, ), image: DecorationImage( image: NetworkImage( '${usersFive.url}', ), fit: BoxFit.cover), ), ), ), ), ], ), Text( '${usersFive.post??''}', textDirection: TextDirection.rtl, style: TextStyle( fontWeight: FontWeight.w500, fontSize: 14, ), ), ], ), ), Container( height: 350, width: double.infinity, child: Column( children: [ Expanded( flex: 2, child: Row( children: [ Expanded( child: OpenContainer( transitionDuration: Duration(seconds: 1), transitionType: ContainerTransitionType.fadeThrough, openBuilder: (BuildContext context, void Function({Object? returnValue}) action) { moveToIndex(0).catchError((onError){}); return Container( color: Colors.white, child: SafeArea( child: Padding( padding: const EdgeInsetsDirectional.only(top: 10), child: ScrollablePositionedList.builder( scrollDirection: Axis.vertical, itemCount: 34, itemScrollController: itemScrollController, itemBuilder: (context , index){ return selectItem[index]; }, ), ), ), ); }, closedBuilder: (BuildContext context, void Function() action) { return selectItem[6]; }, ), ), SizedBox( width: 3, ), Expanded( child: OpenContainer( transitionDuration: Duration(seconds: 1), transitionType: ContainerTransitionType.fadeThrough, openBuilder: (BuildContext context, void Function({Object? returnValue}) action) { moveToIndex(7).catchError((onError){}); return Container( color: Colors.white, child: SafeArea( child: Padding( padding: const EdgeInsetsDirectional.only(top: 10), child: ScrollablePositionedList.builder( scrollDirection: Axis.vertical, itemCount: 34, itemScrollController: itemScrollController, itemBuilder: (context , index){ return selectItem[index]; }, ), ), ), ); }, closedBuilder: (BuildContext context, void Function() action) { return selectItem[12]; }, ), ), ], ), ), SizedBox( height: 3, ), Expanded( flex: 1, child: Row( children: [ Expanded( child: OpenContainer( transitionDuration: Duration(seconds: 1), transitionType: ContainerTransitionType.fadeThrough, openBuilder: (BuildContext context, void Function({Object? returnValue}) action) { moveToIndex(13).catchError((onError){}); return Container( color: Colors.white, child: SafeArea( child: Padding( padding: const EdgeInsetsDirectional.only(top: 10), child: ScrollablePositionedList.builder( scrollDirection: Axis.vertical, itemCount: 34, itemScrollController: itemScrollController, itemBuilder: (context , index){ return selectItem[index]; }, ), ), ), ); }, closedBuilder: (BuildContext context, void Function() action) { return selectItem[18]; }, ), ), SizedBox( width: 3, ), Expanded( child: OpenContainer( transitionDuration: Duration(seconds: 1), transitionType: ContainerTransitionType.fadeThrough, openBuilder: (BuildContext context, void Function({Object? returnValue}) action) { moveToIndex(19).catchError((onError){}); return Container( color: Colors.white, child: SafeArea( child: Padding( padding: const EdgeInsetsDirectional.only(top: 10), child: ScrollablePositionedList.builder( scrollDirection: Axis.vertical, itemCount: 34, itemScrollController: itemScrollController, itemBuilder: (context , index){ return selectItem[index]; }, ), ), ), ); }, closedBuilder: (BuildContext context, void Function() action) { return selectItem[24]; }, ), ), SizedBox( width: 3, ), Expanded( child: OpenContainer( transitionDuration: Duration(seconds: 1), transitionType: ContainerTransitionType.fadeThrough, openBuilder: (BuildContext context, void Function({Object? returnValue}) action) { moveToIndex(25).catchError((onError){}); return Container( color: Colors.white, child: SafeArea( child: Padding( padding: const EdgeInsetsDirectional.only(top: 10), child: ScrollablePositionedList.builder( scrollDirection: Axis.vertical, itemCount: 34, itemScrollController: itemScrollController, itemBuilder: (context , index){ return selectItem[index]; }, ), ), ), ); }, closedBuilder: (BuildContext context, void Function() action) { return selectItem[30]; }, ), ), ], ), ), ], ), ), Padding( padding: const EdgeInsets.all(12.0), child: Container( width: double.infinity, child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Row( children: [ Text( '${usersFive.share_count}', textDirection: TextDirection.rtl, style: TextStyle( color: Colors.grey, ), ), SizedBox( width: 5, ), Text( '${usersFive.comment_count}', textDirection: TextDirection.rtl, style: TextStyle( color: Colors.grey, ), ), Expanded( child: Container( height: 20, child: Wrap( direction: Axis.horizontal, alignment: WrapAlignment.end, crossAxisAlignment: WrapCrossAlignment.center, children: [ Text( '${usersFive.like_count}', textDirection: TextDirection.rtl, style: TextStyle( color: Colors.grey, ), ), Stack( children: [ Container( width: 55, height: 20, ), PositionedDirectional( end: 0, child: Container( height: 20, width: 20, decoration: BoxDecoration( border: Border.all( color: Colors.white, width: 1.5), borderRadius: BorderRadius.circular(18)), child: SvgPicture.asset( '${usersFive.first_rect}', ), ), ), PositionedDirectional( end: 16, child: Container( height: 20, width: 20, decoration: BoxDecoration( border: Border.all( color: Colors.white, width: 1.5), borderRadius: BorderRadius.circular(18)), child: SvgPicture.asset( '${usersFive.second_rect}', ), ), ), PositionedDirectional( end: 32, child: Container( height: 20, width: 20, decoration: BoxDecoration( border: Border.all( color: Colors.white, width: 1.5), borderRadius: BorderRadius.circular(18)), child: SvgPicture.asset( '${usersFive.thirty_rect}', ), ), ), ], ), ], ), ), ), ], ), SizedBox( height: 15, ), Row( children: [ Expanded( child: Container( child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Text( 'مشاركة', style: TextStyle( color: Colors.grey, fontWeight: FontWeight.w600, ), ), Icon( CustomIcons .arrow_curved_to_the_left_svgrepo_com, color: Colors.grey, ), ], ), ), ), Expanded( child: Container( child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Text( 'تعليق', style: TextStyle( color: Colors.grey, fontWeight: FontWeight.w600, ), ), Icon( CustomIcons.comment_svgrepo_com, color: Colors.grey, ), ], ), ), ), Expanded( child: Container( child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Text( 'أعجبنى', style: TextStyle( color: Colors.grey, fontWeight: FontWeight.w600, ), ), SizedBox( width: 10, ), Icon( CustomIcons.like_svgrepo_com, color: Colors.grey, size: 20, ), ], ), ), ), ], ), ], ), ), ), ], ), ); }
0
mirrored_repositories/facebook_flutter/lib/modul
mirrored_repositories/facebook_flutter/lib/modul/posts/post_five.dart
import 'package:flutter/material.dart'; class PostFive extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( body: Column( children: [ Container( height: 100, width: 100, color: Colors.lightGreen, ) ], ), ); } }
0
mirrored_repositories/facebook_flutter/lib/modul
mirrored_repositories/facebook_flutter/lib/modul/login/login_screen.dart
import 'package:conditional_builder_null_safety/conditional_builder_null_safety.dart'; import 'package:facebook/layout/home/home_screen.dart'; import 'package:facebook/modul/login/login_cubit/login_cubit.dart'; import 'package:facebook/modul/login/login_cubit/login_states.dart'; import 'package:facebook/modul/register/register_screen.dart'; import 'package:facebook/shared/components/component.dart'; import 'package:facebook/shared/style/color.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; class LoginScreen extends StatelessWidget { final TextEditingController emailController = TextEditingController(); final TextEditingController passwordController = TextEditingController(); @override Widget build(BuildContext context) { return BlocConsumer<LoginCubit, LoginStates>( listener: (context, state) { if (state is LoginSuccessState) { navigateAndFinish(context: context, widget: HomeScreen()); } }, builder: (context, state) { var loginCubit = LoginCubit.get(context); return SafeArea( child: Scaffold( body: SingleChildScrollView( child: Column( children: [ SizedBox( width: double.infinity, ), Image( image: AssetImage( 'assets/images/login.jpeg', ), fit: BoxFit.cover, width: double.infinity, ), Column( children: [ Row( mainAxisAlignment: MainAxisAlignment.center, children: [ TextButton( onPressed: () {}, child: Text('...المزيد'), ), InkWell( onTap: () {}, child: Text('English'), ), SizedBox( width: 8, ), InkWell( onTap: () {}, child: Text('Francais'), ), ], ), SizedBox( height: 20, ), Padding( padding: const EdgeInsets.symmetric( vertical: 20, horizontal: 30, ), child: Column( children: [ DefaultTextFormField( hint: 'رقم الهاتف أو البريد الأكترونى', controller: emailController, textInputType: TextInputType.emailAddress, validator: (value) { if (value!.isEmpty) return 'يرجى أدخال البريد الأكترونى'; }, ), DefaultTextFormField( hint: 'كلمة السر', controller: passwordController, textInputType: TextInputType.visiblePassword, prefixIcon: IconButton( onPressed: () { loginCubit.toggleObscure(); }, icon: Icon( Icons.remove_red_eye, ), ), isHide: loginCubit.isHide, ), ConditionalBuilder( condition: state is! LoginLoadingState, builder: (context) => Container( padding: EdgeInsetsDirectional.only(top: 12.0), width: double.infinity, child: MaterialButton( onPressed: () { loginCubit.loginWithEmail( email: emailController.text, password: passwordController.text, ); }, child: Text( 'تسجيل الدخول', style: TextStyle( color: Colors.white, fontWeight: FontWeight.bold), ), color: primaryColor, ), ), fallback: (context) => Padding( padding: const EdgeInsets.all(8.0), child: CircularProgressIndicator(), ), ), TextButton( onPressed: () {}, child: Text( 'هل نسيت كلمة السر؟', style: TextStyle( color: primaryColor, fontWeight: FontWeight.bold, ), ), ), SizedBox( height: 60.0, ), Row( children: [ Expanded( child: Container( height: 1, color: Colors.grey, ), ), Padding( padding: const EdgeInsets.symmetric( horizontal: 8.0), child: Text( 'أو', style: TextStyle( color: Colors.grey, ), ), ), Expanded( child: Container( height: 1, color: Colors.grey, ), ), ], ), SizedBox( height: 60.0, ), Container( padding: EdgeInsets.symmetric(horizontal: 60.0), width: double.infinity, child: MaterialButton( onPressed: () { navigateTo( context: context, widget: RegisterScreen()); }, child: Text( 'أنشاء حساب جديد على فيسبوك', style: TextStyle( color: Colors.white, fontWeight: FontWeight.bold), ), color: color2, ), ), ], ), ), ], ), ], ), ), ), ); }, ); } }
0
mirrored_repositories/facebook_flutter/lib/modul/login
mirrored_repositories/facebook_flutter/lib/modul/login/login_cubit/login_cubit.dart
import 'package:bloc/bloc.dart'; import 'package:firebase_auth/firebase_auth.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'login_states.dart'; class LoginCubit extends Cubit<LoginStates> { LoginCubit() : super(InitialLoginState()); Widget? prefixIcon; bool isHide = false; FirebaseAuth auth = FirebaseAuth.instance; static LoginCubit get(context) => BlocProvider.of(context); void toggleObscure() { isHide = !isHide; emit(ToggleObscureState()); } void loginWithEmail({ required String email, required String password, }) { emit(LoginLoadingState()); auth.signInWithEmailAndPassword(email: email, password: password) .then((value) { emit(LoginSuccessState()); print('Success'); }).catchError((onError){ emit(LoginErrorState(error: onError.toString())); print( 'Error ${onError.toString()}'); }); } }
0
mirrored_repositories/facebook_flutter/lib/modul/login
mirrored_repositories/facebook_flutter/lib/modul/login/login_cubit/login_states.dart
abstract class LoginStates{} class InitialLoginState extends LoginStates{} class ToggleObscureState extends LoginStates{} class LoginSuccessState extends LoginStates{} class LoginLoadingState extends LoginStates{} class LoginErrorState extends LoginStates{ String? error; LoginErrorState({this.error}); }
0
mirrored_repositories/facebook_flutter/lib/modul
mirrored_repositories/facebook_flutter/lib/modul/register/register_screen.dart
import 'package:facebook/modul/register/form_screen.dart'; import 'package:facebook/shared/components/component.dart'; import 'package:facebook/shared/components/constant.dart'; import 'package:facebook/shared/style/color.dart'; import 'package:flutter/material.dart'; class RegisterScreen extends StatelessWidget { const RegisterScreen({Key? key}) : super(key: key); @override Widget build(BuildContext context) { editStatusBar(color: Colors.white, icon: Brightness.dark); return Scaffold( backgroundColor: Colors.white, appBar: AppBar( backgroundColor: Colors.white, elevation: 5, actions: [ Center( child: Text( 'أنشاء حساب', style: TextStyle(color: Colors.black, fontSize: 18), ), ), SizedBox( width: 15, ), IconButton( onPressed: () { navigateBack(context); }, icon: Icon( Icons.arrow_forward_rounded, color: Colors.black, ), ), ], ), body: Column( children: [ SizedBox( width: double.infinity, ), Image( image: AssetImage( 'assets/images/wel.jpg', ), height: 300, width: 300, ), Text( 'الانضمام الى فيسبوك', style: TextStyle( color: Colors.black, fontSize: 18, fontWeight: FontWeight.w600, ), ), Text( 'سنساعدك على إنشاء حساب جديد فى بضع خطوات سهلة', style: TextStyle( color: Colors.grey, ), ), SizedBox( height: 50, ), Container( width: double.infinity, height: 80, padding: EdgeInsetsDirectional.all(20), child: Material( borderRadius: BorderRadius.circular(5), clipBehavior: Clip.antiAlias, child: MaterialButton( onPressed: () { navigateTo(context: context , widget: FormScreen()); }, color: primaryColor, child: Text( 'التالى', style: TextStyle( color: Colors.white, ), ), ), ), ), Spacer(), TextButton( onPressed: () { navigateBack(context); }, child: Text( 'هل لديك حساب بالفعل', style: TextStyle( color: primaryColor, fontWeight: FontWeight.bold ), ), ), ], ), ); } }
0
mirrored_repositories/facebook_flutter/lib/modul
mirrored_repositories/facebook_flutter/lib/modul/register/form_screen.dart
import 'package:facebook/layout/home/home_screen.dart'; import 'package:facebook/modul/register/register_cubit/register_cubit.dart'; import 'package:facebook/modul/register/register_cubit/register_states.dart'; import 'package:facebook/shared/components/component.dart'; import 'package:facebook/shared/style/color.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; class FormScreen extends StatelessWidget { final TextEditingController nameController = TextEditingController(); final TextEditingController emailController = TextEditingController(); final TextEditingController passwordController = TextEditingController(); final TextEditingController phoneController = TextEditingController(); @override Widget build(BuildContext context) { return BlocProvider( create: (context) => RegisterCubit(), child: BlocConsumer<RegisterCubit , RegisterStates>( listener: (context , state ){ if(state is RegisterSuccessState){ navigateAndFinish(context: context , widget: HomeScreen()); } }, builder: (context , state ){ var registerCubit = RegisterCubit.get(context); return Scaffold( appBar: AppBar( backgroundColor: Colors.white, ), body: Padding( padding: const EdgeInsets.all(20.0), child: SingleChildScrollView( child: Column( children: [ DefaultTextFormField( hint: 'الاسم', controller: nameController, ), SizedBox( height: 20, ), DefaultTextFormField( hint: 'البريد الاكترونى ', controller: emailController, textInputType: TextInputType.emailAddress, ), SizedBox( height: 20, ), DefaultTextFormField( hint: 'كلمة السر', controller: passwordController, ), SizedBox( height: 20, ), DefaultTextFormField( hint: 'رقم الهاتف', controller: phoneController, ), SizedBox( height: 20, ), Container( width: double.infinity, height: 80, padding: EdgeInsetsDirectional.all(20), child: Material( borderRadius: BorderRadius.circular(5), clipBehavior: Clip.antiAlias, child: MaterialButton( onPressed: () { registerCubit.registerFacebook( name: nameController.text, email: emailController.text, password: passwordController.text, phone: passwordController.text, ); }, color: primaryColor, child: Text( 'تسجيل', style: TextStyle( color: Colors.white, ), ), ), ), ), ], ), ), ), ); }, ), ); } }
0
mirrored_repositories/facebook_flutter/lib/modul/register
mirrored_repositories/facebook_flutter/lib/modul/register/register_cubit/register_cubit.dart
import 'package:bloc/bloc.dart'; import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:facebook/model/user_model.dart'; import 'package:facebook/modul/register/register_cubit/register_states.dart'; import 'package:firebase_auth/firebase_auth.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; class RegisterCubit extends Cubit<RegisterStates> { FirebaseAuth? _firebaseAuth ; UserModel? _userModel; FirebaseFirestore? _firebaseFirestore; RegisterCubit() : super(InitialRegisterState()); static RegisterCubit get(context) => BlocProvider.of(context); void registerFacebook({ required String name, required String email, required String password, required String phone, }) { _firebaseAuth = FirebaseAuth.instance; _firebaseAuth!.createUserWithEmailAndPassword(email: email, password: password).then((value) { print('success'); saveFirestore( uId: value.user!.uid, name: name , email: email, phone: phone); }).catchError((onError){ print('Error ${onError.toString()}'); }); } void saveFirestore({ required String uId, required String name, required String email, required String phone, }){ _userModel = UserModel(uId: uId, name: name, email: email, phone: phone); _firebaseFirestore = FirebaseFirestore.instance; _firebaseFirestore!.collection('Users').doc(uId).set(_userModel!.toMap()).then((value){ print('success'); emit(RegisterSuccessState()); }).catchError((onError){ emit(RegisterErrorState(error: onError.toString())); print('Error ${onError.toString()}'); }); } }
0
mirrored_repositories/facebook_flutter/lib/modul/register
mirrored_repositories/facebook_flutter/lib/modul/register/register_cubit/register_states.dart
abstract class RegisterStates{} class InitialRegisterState extends RegisterStates{} class RegisterSuccessState extends RegisterStates{} class RegisterLoadingState extends RegisterStates{} class RegisterErrorState extends RegisterStates{ final String? error; RegisterErrorState({this.error}); }
0
mirrored_repositories/facebook_flutter/lib
mirrored_repositories/facebook_flutter/lib/model/local_data.dart
class LocalData { final String name; final String url; final String message; final String? story; final String? post; final String? post_image; final String? two_post_image; final String? three_post_image; final String? four_post_image; final String? five_post_image; final String? date; final String? like_count; final String? comment_count; final String? share_count; final String? first_rect; final String? second_rect; final String? thirty_rect; LocalData({ required this.name, required this.url, required this.message, this.story, this.post, this.post_image, this.two_post_image, this.three_post_image, this.four_post_image, this.five_post_image, this.date, this.like_count, this.comment_count, this.share_count, this.first_rect, this.second_rect, this.thirty_rect, }); }
0
mirrored_repositories/facebook_flutter/lib
mirrored_repositories/facebook_flutter/lib/model/user_model.dart
class UserModel { String? name; String? email; String? phone; String? uId; UserModel({ required this.name, required this.email, required this.phone, required this.uId, }); UserModel.fromJson(Map<String, dynamic> json) { this.name = json['name']; this.email = json['email']; this.phone = json['phone']; this.uId = json['uId']; } Map<String, dynamic> toMap() { return { 'name': this.name, 'email': this.email, 'phone': this.phone, 'uId': this.uId, }; } }
0
mirrored_repositories/facebook_flutter/lib/layout
mirrored_repositories/facebook_flutter/lib/layout/home/home_screen.dart
import 'package:facebook/modul/home_page/home_page_screen.dart'; import 'package:facebook/shared/components/constant.dart'; import 'package:facebook/shared/style/color.dart'; import 'package:facebook/shared/style/custom_icons_icons.dart'; import 'package:facebook/shared/style/icon_broken.dart'; import 'package:flutter/material.dart'; import 'package:flutter/semantics.dart'; import 'package:flutter/services.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'home_cubit/home_cubit.dart'; import 'home_cubit/home_states.dart'; class HomeScreen extends StatefulWidget { @override _HomeScreenState createState() => _HomeScreenState(); } class _HomeScreenState extends State<HomeScreen> with SingleTickerProviderStateMixin { TabController? tabController; ScrollController? _scrollController; @override void initState() { super.initState(); tabController = TabController(vsync: this, length: 6, initialIndex: 5); _scrollController =ScrollController(); } final List<Widget> icons = [ Icon( Icons.home_rounded, size: 35, ), Icon( Icons.home_rounded, size: 35, ), Icon( Icons.home_rounded, size: 35, ), Icon( Icons.ondemand_video_rounded, size: 28, ), Container( height: 28, width: 28, decoration: BoxDecoration( border: Border.all(color: Colors.grey), borderRadius: BorderRadius.circular(25)), child: SvgPicture.asset( 'assets/icons/account_group.svg', color: Colors.blue, ), ), Icon( Icons.home_rounded, size: 28, ), ]; @override Widget build(BuildContext context) { return BlocProvider( create: (context) { return HomeCubit(); }, child: BlocConsumer<HomeCubit, HomeStates>( listener: (context, state) {}, builder: (context, state) { return Scaffold( body: NestedScrollView( controller: _scrollController, floatHeaderSlivers: true, headerSliverBuilder: ( context, innerBoxIsScrolled){ return [ SliverAppBar( systemOverlayStyle: SystemUiOverlayStyle( statusBarColor: Colors.white, statusBarIconBrightness: Brightness.dark, ), backwardsCompatibility: false, title: Row( children: [ CircleAvatar( radius: 20, backgroundColor: Colors.grey[200], child: IconButton( onPressed: () {}, icon: Icon( CustomIcons.mess_icon, color: Colors.black, size: 20, ), ), ), SizedBox( width: 14.0, ), CircleAvatar( backgroundColor: Colors.grey[200], radius: 20, child: IconButton( onPressed: () {}, icon: Icon( IconBroken.Search, color: Colors.black, size: 20, ), ), ), ], ), actions: [ Padding( padding: const EdgeInsetsDirectional.only( end: 20.0, ), child: Center( child: Text( 'facebook', style: TextStyle( color: primaryColor, fontSize: 28, letterSpacing: -0.8, fontWeight: FontWeight.bold, ), ), ), ), ], pinned: true, floating: true, forceElevated: innerBoxIsScrolled, elevation: 0.0, backgroundColor: Colors.white, bottom: TabBar( unselectedLabelColor: Colors.grey, controller: tabController, labelColor: Colors.blue, labelPadding: EdgeInsets.symmetric(horizontal: 0.0), tabs: [ Tab( child: Icon( Icons.menu, ), ), Tab( child: Icon( CustomIcons.bell_noti, ), ), Tab( child: Icon( CustomIcons.store, ), ), Tab( child: Icon( CustomIcons.facebook, ), ), Tab( child: Icon( CustomIcons.group, ), ), Tab( child: Icon( IconBroken.Home, ), ), ], onTap: (value) {}, ), ), ]; }, body: TabBarView( controller: tabController, children: [ TextButton( onPressed: () {}, child: Text('hello'), ), TextButton( onPressed: () {}, child: Text('hello'), ), TextButton( onPressed: () {}, child: Text('hello'), ), TextButton( onPressed: () {}, child: Text('hello'), ), TextButton( onPressed: () {}, child: Text('hello'), ), HomePageScreen(), ], ), ), ); }, ), ); } }
0
mirrored_repositories/facebook_flutter/lib/layout/home
mirrored_repositories/facebook_flutter/lib/layout/home/home_cubit/home_cubit.dart
import 'package:bloc/bloc.dart'; import 'package:facebook/model/local_data.dart'; import 'package:facebook/shared/components/constant.dart'; import 'package:facebook/shared/style/color.dart'; import 'package:facebook/shared/style/custom_icons_icons.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_svg/svg.dart'; import 'home_states.dart'; class HomeCubit extends Cubit<HomeStates>{ final List<LocalData> persons = [ LocalData( name: 'Hamada mohamed ', message: 'Hi, i am a software engineer ', url: 'https://serving.photos.photobox.com/25235201d5280a9882ac9a90e30d287c527be9a7e648e6b3207215203329d3271a4fb63b.jpg', story: 'https://morb3.com/wp-content/uploads/2020/01/1-iphone-wallpapers-hd-%D8%AE%D9%84%D9%81%D9%8A%D8%A7%D8%AA-%D8%A7%D9%8A%D9%81%D9%88%D9%86-%D8%A7%D9%94%D9%8A%D9%81%D9%88%D9%86-156.jpg', post: 'الزمالك هذا الموسم \nبطل الدورى لكرة القدم\n بطل الدورى المصرى لكرة اليد\n بطل دورى السوبر المصري لكرة السلة \n', post_image: 'https://pbs.twimg.com/media/E7QFvmAWQAExfwo.jpg', date: 'أمس الساعة${arabicNumber.convert(11)}:${arabicNumber.convert(30)}م', comment_count: '${arabicNumber.convert(5606)} تعليقا ', like_count: '${arabicNumber.convert(221873)}', share_count: '${arabicNumber.convert(1050)} مشاركة ', first_rect: 'assets/icons/facebook_love.svg', second_rect: 'assets/icons/care.svg', thirty_rect: 'assets/icons/facebook_like.svg', ), LocalData( name: 'sara ahmed', message: 'It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout', url: 'https://images.unsplash.com/photo-1438761681033-6461ffad8d80?ixid=MnwxMjA3fDB8MHxzZWFyY2h8MXx8cGVyc29ufGVufDB8fDB8fA%3D%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=1100&q=60', story: 'https://w0.peakpx.com/wallpaper/887/576/HD-wallpaper-clock-minimal-creative-blue-background-creative-clock.jpg', post: 'It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout', post_image: 'https://i.pinimg.com/originals/03/32/2e/03322eae80f035d972d64ca3bd1c38cc.jpg', date: 'أمس الساعة${arabicNumber.convert(01)}:${arabicNumber.convert(45)}م', comment_count: '${arabicNumber.convert(120)} تعليقا ', like_count: '${arabicNumber.convert(500)}', share_count: '${arabicNumber.convert(23)} مشاركة ', first_rect: 'assets/icons/facebook_haha.svg', second_rect: 'assets/icons/facebook_wow.svg', thirty_rect: 'assets/icons/facebook_sad.svg', ), LocalData( name: 'Machiel', message: 'It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout', url: 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRb8K3r8wnRGKL-taFuE8Pz6nf7XvsD8aOWGA&usqp=CAU', story: 'https://i.pinimg.com/originals/03/32/2e/03322eae80f035d972d64ca3bd1c38cc.jpg', post: 'It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout', post_image: 'https://i.pinimg.com/originals/03/32/2e/03322eae80f035d972d64ca3bd1c38cc.jpg', two_post_image: 'https://i.pinimg.com/originals/03/32/2e/03322eae80f035d972d64ca3bd1c38cc.jpg', three_post_image: 'https://i.pinimg.com/originals/03/32/2e/03322eae80f035d972d64ca3bd1c38cc.jpg', four_post_image: 'https://i.pinimg.com/originals/03/32/2e/03322eae80f035d972d64ca3bd1c38cc.jpg', date: 'أمس الساعة${arabicNumber.convert(01)}:${arabicNumber.convert(45)}م', comment_count: '${arabicNumber.convert(120)} تعليقا ', like_count: '${arabicNumber.convert(500)}', share_count: '${arabicNumber.convert(23)} مشاركة ', first_rect: 'assets/icons/facebook_haha.svg', second_rect: 'assets/icons/facebook_wow.svg', thirty_rect: 'assets/icons/facebook_sad.svg', ), LocalData( name: 'salama', url: 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRmiipzUG3KoBS7uiWIx9M7Z-VUTdT0w-Cn-g&usqp=CAU', message: 'asdasdasdasdasdasdds', story: 'https://images.pexels.com/photos/674010/pexels-photo-674010.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500', ), LocalData( name: 'asdasdfasdsdasda', url: 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTRXs4XLutykcrFtsalR7IDFbn2iy53MB6dpg&usqp=CAU', message: 'asdasdasdasdasdasdds', story: 'https://wallpaperaccess.com/full/1968299.jpg', ), LocalData( name: 'sara', url: 'https://images.unsplash.com/photo-1438761681033-6461ffad8d80?ixid=MnwxMjA3fDB8MHxzZWFyY2h8MXx8cGVyc29ufGVufDB8fDB8fA%3D%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=1100&q=60', message: 'hi i am sara fsdjkfdsdsdsdsdjkg', story: 'https://elements-cover-images-0.imgix.net/dc32fd46-a38b-4b46-8bcd-c722b6c6fc94?auto=compress%2Cformat&fit=max&w=632&s=3c09a22ce4971143ddd4261636818e11', ), LocalData( name: 'hdfghdjkghd fdsdsdsdsdsdf ghj', url: 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRb8K3r8wnRGKL-taFuE8Pz6nf7XvsD8aOWGA&usqp=CAU', message: 'hi i fsdjgfjdfkghdf', story: 'https://images.unsplash.com/photo-1560421683-6856ea585c78?ixid=MnwxMjA3fDB8MHxzZWFyY2h8NHx8Y3JlYXRpdml0eXxlbnwwfHwwfHw%3D&ixlib=rb-1.2.1&w=1000&q=80', ), LocalData( name: 'asdasdfasdsdasda', url: 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRmiipzUG3KoBS7uiWIx9M7Z-VUTdT0w-Cn-g&usqp=CAU', message: 'asdasdasdasdasdasdds', story: 'https://s3.amazonaws.com/susam-files/Wallpapers/Trello+Theme+Exclusive+Creative+Brush/creative_brush_wallpaper_v2-2560x1440.png', ), LocalData( name: 'asdasdfasdsdasda', url: 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTRXs4XLutykcrFtsalR7IDFbn2iy53MB6dpg&usqp=CAU', message: 'asdasdasdasdasdasdds', story: 'https://wallpaperaccess.com/full/637507.jpg', ), LocalData( name: 'sara', url: 'https://images.unsplash.com/photo-1438761681033-6461ffad8d80?ixid=MnwxMjA3fDB8MHxzZWFyY2h8MXx8cGVyc29ufGVufDB8fDB8fA%3D%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=1100&q=60', message: 'hi i am sara fsdjkfdsdsdsdsdjkg', story: 'https://images.unsplash.com/photo-1583223667854-e0e05b1ad4f3?ixid=MnwxMjA3fDB8MHxzZWFyY2h8MXx8aHAlMjBsYXB0b3B8ZW58MHx8MHx8&ixlib=rb-1.2.1&w=1000&q=80', ), LocalData( name: 'hdfghdjkghd fdsdsdsdsdsdf ghj', url: 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRb8K3r8wnRGKL-taFuE8Pz6nf7XvsD8aOWGA&usqp=CAU', message: 'hi i fsdjgfjdfkghdf', story: 'https://elements-cover-images-0.imgix.net/dc32fd46-a38b-4b46-8bcd-c722b6c6fc94?auto=compress%2Cformat&fit=max&w=632&s=3c09a22ce4971143ddd4261636818e11'), LocalData( name: 'asdasdfasdsdasda', url: 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRmiipzUG3KoBS7uiWIx9M7Z-VUTdT0w-Cn-g&usqp=CAU', message: 'asdasdasdasdasdasdds', story: 'https://img.fotocommunity.com/bulb-of-knowledge-560651dc-d49b-47bb-b90f-6340596d6572.jpg?height=1080', ), LocalData( name: 'asdasdfasdsdasda', url: 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRmiipzUG3KoBS7uiWIx9M7Z-VUTdT0w-Cn-g&usqp=CAU', message: 'asdasdasdasdasdasdds', story: 'https://img.fotocommunity.com/bulb-of-knowledge-560651dc-d49b-47bb-b90f-6340596d6572.jpg?height=1080', ), LocalData( name: 'sara', url: 'https://images.unsplash.com/photo-1438761681033-6461ffad8d80?ixid=MnwxMjA3fDB8MHxzZWFyY2h8MXx8cGVyc29ufGVufDB8fDB8fA%3D%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=1100&q=60', message: 'hi i am sara fsdjkfdsdsdsdsdjkg', story: 'https://images.pexels.com/photos/674010/pexels-photo-674010.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500', ), LocalData( name: 'hdfghdjkghd fdsdsdsdsdsdf ghj', url: 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRb8K3r8wnRGKL-taFuE8Pz6nf7XvsD8aOWGA&usqp=CAU', message: 'hi i fsdjgfjdfkghdf', story: 'https://i.pinimg.com/736x/76/c5/5f/76c55f279c052c5eeaccf8162e3fb629.jpg', ), LocalData( name: 'asdasdfasdsdasda', url: 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRmiipzUG3KoBS7uiWIx9M7Z-VUTdT0w-Cn-g&usqp=CAU', message: 'asdasdasdasdasdasdds', story: 'https://c4.wallpaperflare.com/wallpaper/465/78/448/humor-motivational-black-background-minimalism-wallpaper-preview.jpg', ), LocalData( name: 'asdasdfasdsdasda', url: 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTRXs4XLutykcrFtsalR7IDFbn2iy53MB6dpg&usqp=CAU', message: 'asdasdasdasdasdasdds', story: 'https://img5.goodfon.com/wallpaper/nbig/2/ac/abstract-background-colorful-rounded-shapes-abstraktsiia-fon.jpg', ), ]; final List<LocalData> persons_four = [ LocalData( name: 'Machiel', message: 'It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout', url: 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRb8K3r8wnRGKL-taFuE8Pz6nf7XvsD8aOWGA&usqp=CAU', story: 'https://i.pinimg.com/originals/03/32/2e/03322eae80f035d972d64ca3bd1c38cc.jpg', post: 'It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout', post_image: 'https://wallpaperaccess.com/full/1968299.jpg', two_post_image: 'https://i.pinimg.com/originals/03/32/2e/03322eae80f035d972d64ca3bd1c38cc.jpg', three_post_image: 'https://img5.goodfon.com/wallpaper/nbig/2/ac/abstract-background-colorful-rounded-shapes-abstraktsiia-fon.jpg', four_post_image: 'https://img.fotocommunity.com/bulb-of-knowledge-560651dc-d49b-47bb-b90f-6340596d6572.jpg?height=1080', date: 'اليوم الساعة${arabicNumber.convert(05)}:${arabicNumber.convert(15)}م', comment_count: '${arabicNumber.convert(700)} تعليقا ', like_count: '${arabicNumber.convert(5220)}', share_count: '${arabicNumber.convert(2213)} مشاركة ', first_rect: 'assets/icons/facebook_haha.svg', second_rect: 'assets/icons/facebook_wow.svg', thirty_rect: 'assets/icons/facebook_sad.svg', ), LocalData( name: 'Sara ahmed', message: 'It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout', url: 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTRXs4XLutykcrFtsalR7IDFbn2iy53MB6dpg&usqp=CAU', story: 'https://i.pinimg.com/originals/03/32/2e/03322eae80f035d972d64ca3bd1c38cc.jpg', post: 'It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout', post_image: 'https://img5.goodfon.com/wallpaper/nbig/2/ac/abstract-background-colorful-rounded-shapes-abstraktsiia-fon.jpg', two_post_image: 'https://w0.peakpx.com/wallpaper/887/576/HD-wallpaper-clock-minimal-creative-blue-background-creative-clock.jpg', three_post_image: 'https://i.pinimg.com/originals/03/32/2e/03322eae80f035d972d64ca3bd1c38cc.jpg', four_post_image: 'https://i.pinimg.com/originals/03/32/2e/03322eae80f035d972d64ca3bd1c38cc.jpg', date: 'أمس الساعة${arabicNumber.convert(03)}:${arabicNumber.convert(54)}م', comment_count: '${arabicNumber.convert(12000)} تعليقا ', like_count: '${arabicNumber.convert(504410)}', share_count: '${arabicNumber.convert(2233)} مشاركة ', first_rect: 'assets/icons/facebook_haha.svg', second_rect: 'assets/icons/facebook_wow.svg', thirty_rect: 'assets/icons/facebook_sad.svg', ), ]; final List<LocalData> person_two = [ LocalData( name: 'salama', message: 'It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout', url: 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRmiipzUG3KoBS7uiWIx9M7Z-VUTdT0w-Cn-g&usqp=CAU', story: 'https://i.pinimg.com/originals/03/32/2e/03322eae80f035d972d64ca3bd1c38cc.jpg', post: 'It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout', post_image: 'https://wallpaperaccess.com/full/1968299.jpg', two_post_image: 'https://i.pinimg.com/originals/03/32/2e/03322eae80f035d972d64ca3bd1c38cc.jpg', three_post_image: 'https://img5.goodfon.com/wallpaper/nbig/2/ac/abstract-background-colorful-rounded-shapes-abstraktsiia-fon.jpg', four_post_image: 'https://img.fotocommunity.com/bulb-of-knowledge-560651dc-d49b-47bb-b90f-6340596d6572.jpg?height=1080', date: 'اليوم الساعة${arabicNumber.convert(05)}:${arabicNumber.convert(15)}م', comment_count: '${arabicNumber.convert(700)} تعليقا ', like_count: '${arabicNumber.convert(5220)}', share_count: '${arabicNumber.convert(2213)} مشاركة ', first_rect: 'assets/icons/facebook_haha.svg', second_rect: 'assets/icons/facebook_wow.svg', thirty_rect: 'assets/icons/facebook_sad.svg', ), LocalData( name: 'Sara ahmed', message: 'It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout', url: 'https://images.unsplash.com/photo-1438761681033-6461ffad8d80?ixid=MnwxMjA3fDB8MHxzZWFyY2h8MXx8cGVyc29ufGVufDB8fDB8fA%3D%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=1100&q=60', story: 'https://i.pinimg.com/originals/03/32/2e/03322eae80f035d972d64ca3bd1c38cc.jpg', post: 'It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout', post_image: 'https://img5.goodfon.com/wallpaper/nbig/2/ac/abstract-background-colorful-rounded-shapes-abstraktsiia-fon.jpg', two_post_image: 'https://i.pinimg.com/originals/03/32/2e/03322eae80f035d972d64ca3bd1c38cc.jpg', three_post_image: 'https://i.pinimg.com/originals/03/32/2e/03322eae80f035d972d64ca3bd1c38cc.jpg', four_post_image: 'https://i.pinimg.com/originals/03/32/2e/03322eae80f035d972d64ca3bd1c38cc.jpg', date: 'أمس الساعة${arabicNumber.convert(03)}:${arabicNumber.convert(54)}م', comment_count: '${arabicNumber.convert(12000)} تعليقا ', like_count: '${arabicNumber.convert(504410)}', share_count: '${arabicNumber.convert(2233)} مشاركة ', first_rect: 'assets/icons/facebook_haha.svg', second_rect: 'assets/icons/facebook_wow.svg', thirty_rect: 'assets/icons/facebook_sad.svg', ), ]; final List<LocalData> person_three = [ LocalData( name: 'Machiel', message: 'It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout', url: 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRb8K3r8wnRGKL-taFuE8Pz6nf7XvsD8aOWGA&usqp=CAU', story: 'https://i.pinimg.com/originals/03/32/2e/03322eae80f035d972d64ca3bd1c38cc.jpg', post: 'It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout', post_image: 'https://wallpaperaccess.com/full/1968299.jpg', two_post_image: 'https://i.pinimg.com/originals/03/32/2e/03322eae80f035d972d64ca3bd1c38cc.jpg', three_post_image: 'https://img5.goodfon.com/wallpaper/nbig/2/ac/abstract-background-colorful-rounded-shapes-abstraktsiia-fon.jpg', four_post_image: 'https://img.fotocommunity.com/bulb-of-knowledge-560651dc-d49b-47bb-b90f-6340596d6572.jpg?height=1080', date: 'اليوم الساعة${arabicNumber.convert(05)}:${arabicNumber.convert(15)}م', comment_count: '${arabicNumber.convert(700)} تعليقا ', like_count: '${arabicNumber.convert(5220)}', share_count: '${arabicNumber.convert(2213)} مشاركة ', first_rect: 'assets/icons/facebook_haha.svg', second_rect: 'assets/icons/facebook_wow.svg', thirty_rect: 'assets/icons/facebook_sad.svg', ), LocalData( name: 'Sara ahmed', message: 'It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout', url: 'https://images.unsplash.com/photo-1438761681033-6461ffad8d80?ixid=MnwxMjA3fDB8MHxzZWFyY2h8MXx8cGVyc29ufGVufDB8fDB8fA%3D%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=1100&q=60', story: 'https://i.pinimg.com/originals/03/32/2e/03322eae80f035d972d64ca3bd1c38cc.jpg', post: 'It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout', post_image: 'https://img5.goodfon.com/wallpaper/nbig/2/ac/abstract-background-colorful-rounded-shapes-abstraktsiia-fon.jpg', two_post_image: 'https://i.pinimg.com/originals/03/32/2e/03322eae80f035d972d64ca3bd1c38cc.jpg', three_post_image: 'https://i.pinimg.com/originals/03/32/2e/03322eae80f035d972d64ca3bd1c38cc.jpg', four_post_image: 'https://i.pinimg.com/originals/03/32/2e/03322eae80f035d972d64ca3bd1c38cc.jpg', date: 'أمس الساعة${arabicNumber.convert(03)}:${arabicNumber.convert(54)}م', comment_count: '${arabicNumber.convert(12000)} تعليقا ', like_count: '${arabicNumber.convert(504410)}', share_count: '${arabicNumber.convert(2233)} مشاركة ', first_rect: 'assets/icons/facebook_haha.svg', second_rect: 'assets/icons/facebook_wow.svg', thirty_rect: 'assets/icons/facebook_sad.svg', ), ]; final List<LocalData> person_five = [ LocalData( name: 'Machiel', message: 'It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout', url: 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRb8K3r8wnRGKL-taFuE8Pz6nf7XvsD8aOWGA&usqp=CAU', story: 'https://i.pinimg.com/originals/03/32/2e/03322eae80f035d972d64ca3bd1c38cc.jpg', post: 'It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout', post_image: 'https://wallpaperaccess.com/full/1968299.jpg', two_post_image: 'https://i.pinimg.com/originals/03/32/2e/03322eae80f035d972d64ca3bd1c38cc.jpg', three_post_image: 'https://img5.goodfon.com/wallpaper/nbig/2/ac/abstract-background-colorful-rounded-shapes-abstraktsiia-fon.jpg', four_post_image: 'https://img.fotocommunity.com/bulb-of-knowledge-560651dc-d49b-47bb-b90f-6340596d6572.jpg?height=1080', five_post_image: 'https://img.fotocommunity.com/bulb-of-knowledge-560651dc-d49b-47bb-b90f-6340596d6572.jpg?height=1080', date: 'اليوم الساعة${arabicNumber.convert(05)}:${arabicNumber.convert(15)}م', comment_count: '${arabicNumber.convert(700)} تعليقا ', like_count: '${arabicNumber.convert(5220)}', share_count: '${arabicNumber.convert(2213)} مشاركة ', first_rect: 'assets/icons/facebook_haha.svg', second_rect: 'assets/icons/facebook_wow.svg', thirty_rect: 'assets/icons/facebook_sad.svg', ), LocalData( name: 'Sara ahmed', message: 'It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout', url: 'https://images.unsplash.com/photo-1438761681033-6461ffad8d80?ixid=MnwxMjA3fDB8MHxzZWFyY2h8MXx8cGVyc29ufGVufDB8fDB8fA%3D%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=1100&q=60', story: 'https://i.pinimg.com/originals/03/32/2e/03322eae80f035d972d64ca3bd1c38cc.jpg', post: 'It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout', post_image: 'https://img5.goodfon.com/wallpaper/nbig/2/ac/abstract-background-colorful-rounded-shapes-abstraktsiia-fon.jpg', two_post_image: 'https://i.pinimg.com/originals/03/32/2e/03322eae80f035d972d64ca3bd1c38cc.jpg', three_post_image: 'https://i.pinimg.com/originals/03/32/2e/03322eae80f035d972d64ca3bd1c38cc.jpg', four_post_image: 'https://i.pinimg.com/originals/03/32/2e/03322eae80f035d972d64ca3bd1c38cc.jpg', five_post_image: 'https://img.fotocommunity.com/bulb-of-knowledge-560651dc-d49b-47bb-b90f-6340596d6572.jpg?height=1080', date: 'أمس الساعة${arabicNumber.convert(03)}:${arabicNumber.convert(54)}م', comment_count: '${arabicNumber.convert(12000)} تعليقا ', like_count: '${arabicNumber.convert(504410)}', share_count: '${arabicNumber.convert(2233)} مشاركة ', first_rect: 'assets/icons/facebook_haha.svg', second_rect: 'assets/icons/facebook_wow.svg', thirty_rect: 'assets/icons/facebook_sad.svg', ), ]; HomeCubit (): super(InitialHomeState()); static HomeCubit get(context) => BlocProvider.of(context); }
0