repo_id
stringlengths 21
168
| file_path
stringlengths 36
210
| content
stringlengths 1
9.98M
| __index_level_0__
int64 0
0
|
---|---|---|---|
mirrored_repositories/Express-Booking-App/lib | mirrored_repositories/Express-Booking-App/lib/login/login.dart | import 'package:express_booking_app/login/login_button.dart';
import 'package:express_booking_app/login/login_button_list.dart';
import 'package:flutter/material.dart';
class Login extends StatelessWidget {
final img = AssetImage("assets/google-logo.png");
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
leading: InkWell(
child: Icon(
Icons.arrow_back_ios,
color: Color(0xFF3834AF),
),
onTap: (){
Navigator.pop(context);
},
),
elevation: 0.0,
),
body: Container(
color: Colors.white,
child: Center(
child: LoginButtonList(),
),
),
);
}
}
| 0 |
mirrored_repositories/Express-Booking-App/lib | mirrored_repositories/Express-Booking-App/lib/bus_companies/header_bar.dart | import 'package:express_booking_app/bus_companies/back_arrow.dart';
import 'package:express_booking_app/bus_companies/circle_avatar_border.dart';
import 'package:flutter/material.dart';
class HeaderBar extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
width: MediaQuery.of(context).size.width,
height: 250,
color: Color(0xFF3834AF),
child: Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
BackArrow(),
AvatarWithBorder(),
],
),
)
);
}
}
| 0 |
mirrored_repositories/Express-Booking-App/lib | mirrored_repositories/Express-Booking-App/lib/bus_companies/bus_company_card.dart | import 'package:express_booking_app/buy_ticket/buy_ticket_screen.dart';
import 'package:flutter/material.dart';
class BusCompanyCard extends StatelessWidget {
String logo;
BusCompanyCard(this.logo);
@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.only(
bottom: 20,
),
padding: EdgeInsets.all(6),
height: 80,
width: 90,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(5),
color: Colors.white,
boxShadow: [
BoxShadow(
color: Color(0xffE2E2F3),
offset: Offset(0, 3),
blurRadius: 3,
spreadRadius: 0
),
BoxShadow(
color: Color(0xffE2E2F3),
offset: Offset(0, 3),
blurRadius: 3,
spreadRadius: 0
),
BoxShadow(
color: Color(0xffE2E2F3),
offset: Offset(0, 3),
blurRadius: 3,
spreadRadius: 0
)
]
),
child: InkWell(
onTap: (){
Navigator.push(context, MaterialPageRoute(builder: (context) => BuyTicketScreen(logo)));
},
child: Center(
child: Image.asset(
logo,
width: 40,
height: 40,
),
),
),
);
}
}
| 0 |
mirrored_repositories/Express-Booking-App/lib | mirrored_repositories/Express-Booking-App/lib/bus_companies/back_arrow.dart | import 'package:flutter/material.dart';
class BackArrow extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
padding: EdgeInsets.only(
top: 40,
left: 10.0,
),
child: InkWell(
child: Icon(
Icons.arrow_back_ios,
size: 30,
color: Colors.white
),
onTap: (){
Navigator.pop(context);
}
),
);
}
}
| 0 |
mirrored_repositories/Express-Booking-App/lib | mirrored_repositories/Express-Booking-App/lib/bus_companies/bus_companies_screen.dart | import 'package:express_booking_app/bus_companies/bus_company_card_list.dart';
import 'package:express_booking_app/bus_companies/bus_company_card.dart';
import 'package:express_booking_app/bus_companies/bus_item_overlap_card.dart';
import 'package:express_booking_app/bus_companies/header_bar.dart';
import 'package:flutter/material.dart';
class BusCompaniesScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
color: Colors.white,
child: Stack(
children: <Widget>[
HeaderBar(),
BusItemCard(),
Container(
margin: EdgeInsets.only(
top: 340
),
child: BusCardsList([
"assets/bus-logo1.png",
"assets/bus-logo2.png",
"assets/bus-logo3.png",
"assets/bus-logo4.png",
"assets/bus-logo5.png",
"assets/bus-logo3.png",
"assets/bus-logo2.png",
"assets/bus-logo1.png",
"assets/bus-logo4.png",
]),
),
],
),
)
);
}
}
| 0 |
mirrored_repositories/Express-Booking-App/lib | mirrored_repositories/Express-Booking-App/lib/bus_companies/bus_screen_foot_buttons.dart | import 'package:flutter/material.dart';
/*class FootButtons extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
RaisedButton(
onPressed: ()=>{},
elevation: 0,
color: Color(0xff3834AF),
padding: EdgeInsets.all(8),
child: Text('Prueba'),
textTheme: ButtonTextTheme.accent,
textColor: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(2),
side: BorderSide(
color: Color(0xff3834AF),
width: 1,
style: BorderStyle.solid
)
),
),
RaisedButton(
onPressed: ()=>{},
elevation: 0,
color: Colors.white,
padding: EdgeInsets.all(8),
child: Text('Prueba2'),
textTheme: ButtonTextTheme.accent,
textColor: Color(0xff3834AF),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(2),
side: BorderSide(
color: Color(0xff3834AF),
width: 1,
style: BorderStyle.solid
)
),
animationDuration: Duration(seconds: 2),
),
],
);
}
}*/
class FootButtons extends StatefulWidget {
@override
FootButtonsState createState() => FootButtonsState();
}
class FootButtonsState extends State<FootButtons> {
var acOn = false;
@override
Widget build(BuildContext context) {
return Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
RaisedButton(
onPressed: () => setState(() {
if(acOn){
acOn = false;
}
}),
elevation: 0,
color: acOn? Colors.white: Color(0xff3834AF) ,
padding: EdgeInsets.all(8),
child: Text(
'AC',
style: TextStyle(
fontWeight: FontWeight.w600
),
),
textTheme: ButtonTextTheme.accent,
textColor: acOn ? Color(0xff3834AF):Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(5),
bottomLeft: Radius.circular(5)
),
side: BorderSide(
color: Color(0xff3834AF),
width: 1,
style: BorderStyle.solid
)
),
),
RaisedButton(
onPressed: () => setState(() {
if(!acOn){
acOn = true;
}
}),
elevation: 0,
color: acOn? Color(0xff3834AF) : Colors.white,
padding: EdgeInsets.all(8),
child: Text(
'NON-AC',
style: TextStyle(
fontWeight: FontWeight.w600
),
),
textTheme: ButtonTextTheme.accent,
textColor: acOn? Colors.white: Color(0xff3834AF),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.only(
topRight: Radius.circular(5),
bottomRight: Radius.circular(5)
),
side: BorderSide(
color: Color(0xff3834AF),
width: 1,
style: BorderStyle.solid
)
),
),
],
);
}
}
| 0 |
mirrored_repositories/Express-Booking-App/lib | mirrored_repositories/Express-Booking-App/lib/bus_companies/bus_item_overlap_card.dart | import 'package:flutter/material.dart';
class BusItemCard extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.only(
top:120,
left: 20,
right: 20,
bottom: 20
),
padding: EdgeInsets.all(20),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: Colors.white,
),
child: Image.asset('assets/bus-image.png')
);
}
}
| 0 |
mirrored_repositories/Express-Booking-App/lib | mirrored_repositories/Express-Booking-App/lib/bus_companies/circle_avatar_border.dart | import 'package:flutter/material.dart';
class AvatarWithBorder extends StatelessWidget {
final picLink = "https://pbs.twimg.com/profile_images/725087606522843137/VmtIbx5p_400x400.jpg";
@override
Widget build(BuildContext context) {
return Container(
width: 50,
height: 50,
padding: EdgeInsets.all(0),
margin: EdgeInsets.only(
top: 35,
right: 10
),
decoration: BoxDecoration(
border: Border.all(
color: Colors.white,
style: BorderStyle.solid,
width: 1.0
),
shape: BoxShape.circle,
image: DecorationImage(
image: NetworkImage(picLink),
fit: BoxFit.cover
)
),
);
}
}
| 0 |
mirrored_repositories/Express-Booking-App/lib | mirrored_repositories/Express-Booking-App/lib/bus_companies/bus_screen_wrapper.dart | import 'package:flutter/material.dart';
class BusWrapper extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container();
}
}
| 0 |
mirrored_repositories/Express-Booking-App/lib | mirrored_repositories/Express-Booking-App/lib/bus_companies/bus_company_card_list.dart | import 'package:express_booking_app/bus_companies/bus_company_card.dart';
import 'package:express_booking_app/bus_companies/bus_screen_foot_buttons.dart';
import 'package:flutter/material.dart';
import 'package:express_booking_app/bus_companies/bus_item_overlap_card.dart';
class BusCardsList extends StatelessWidget {
List<String> assetsName;
BusCardsList(this.assetsName);
@override
Widget build(BuildContext context) {
bool _lights = true;
final busList = ListView(
shrinkWrap: bool.fromEnvironment("this",defaultValue: true),
children: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
BusCompanyCard(assetsName.elementAt(0)),
BusCompanyCard(assetsName.elementAt(1)),
BusCompanyCard(assetsName.elementAt(2)),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
BusCompanyCard(assetsName.elementAt(3)),
BusCompanyCard(assetsName.elementAt(4)),
BusCompanyCard(assetsName.elementAt(5)),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
BusCompanyCard(assetsName.elementAt(6)),
BusCompanyCard(assetsName.elementAt(7)),
BusCompanyCard(assetsName.elementAt(8)),
],
),
FootButtons()
],
);
return busList;
}
}
| 0 |
mirrored_repositories/Express-Booking-App | mirrored_repositories/Express-Booking-App/test/widget_test.dart | // This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility 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:express_booking_app/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/crm_app | mirrored_repositories/crm_app/lib/main.dart | import 'package:flutter/material.dart';
import 'core/init/theme/light/app_theme_light.dart';
import 'feature/auth/login/view/login_view.dart';
// arama sms ve şirket içi mesajlaşma
main(List<String> args) {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
theme: AppThemeLight.instance.themeDataLight,
home: const LoginView());
}
}
| 0 |
mirrored_repositories/crm_app/lib/core/constants | mirrored_repositories/crm_app/lib/core/constants/app/app_constants.dart | class ApplicationConstants {
static ApplicationConstants? _instance;
static ApplicationConstants? get instance {
if (_instance != null) {
return _instance;
} else {
_instance = ApplicationConstants.init();
return _instance!;
}
}
ApplicationConstants.init();
final String baseUrl = "http://192.168.3.53/api/";
String token = "";
String projectId = "";
List<String> guiId = [];
List<String> userId = [];
List<String> accessLevel = [];
}
| 0 |
mirrored_repositories/crm_app/lib/core/init | mirrored_repositories/crm_app/lib/core/init/network/network_manager.dart | import 'package:dio/dio.dart';
import '../../constants/app/app_constants.dart';
class NetworkManager {
static NetworkManager? _instance;
static NetworkManager? get instance {
if (_instance != null) {
return _instance;
} else {
_instance = NetworkManager.init();
return _instance!;
}
}
late final Dio dio;
NetworkManager.init() {
dio = Dio(BaseOptions(baseUrl: ApplicationConstants.instance!.baseUrl));
dio.interceptors.add(
InterceptorsWrapper(
onRequest: (options, handler) {
handler.next(options);
},
),
);
}
}
| 0 |
mirrored_repositories/crm_app/lib/core/init | mirrored_repositories/crm_app/lib/core/init/theme/iapp_theme.dart | import 'package:flutter/material.dart';
abstract class IAppTheme {
ThemeData get themeDataLight => ThemeData();
ThemeData get themeDataDark => ThemeData();
}
| 0 |
mirrored_repositories/crm_app/lib/core/init/theme | mirrored_repositories/crm_app/lib/core/init/theme/dark/app_theme_dark.dart | import 'package:flutter/material.dart';
import '../iapp_theme.dart';
class AppThemeDark extends IAppTheme {
static AppThemeDark? _instance;
static AppThemeDark get instance {
if (_instance != null) {
return _instance!;
} else {
_instance = AppThemeDark.init();
return _instance!;
}
}
AppThemeDark.init();
@override
ThemeData get themeDataDark => ThemeData.dark().copyWith();
}
| 0 |
mirrored_repositories/crm_app/lib/core/init/theme | mirrored_repositories/crm_app/lib/core/init/theme/dark/idark_theme.dart | import 'color_scheme_dark.dart';
import 'text_theme_dark.dart';
abstract class IDarkTheme {
ColorSchemeDark colorSchemeDark = ColorSchemeDark.instance;
TextThemeDark textThemeDark = TextThemeDark.instance;
}
| 0 |
mirrored_repositories/crm_app/lib/core/init/theme | mirrored_repositories/crm_app/lib/core/init/theme/dark/color_scheme_dark.dart | import 'package:flutter/material.dart';
class ColorSchemeDark {
static ColorSchemeDark? _instance;
static ColorSchemeDark get instance {
if (_instance != null) {
return _instance!;
} else {
_instance = ColorSchemeDark.init();
return _instance!;
}
}
ColorSchemeDark.init();
final Color brown = const Color(0xffa87e6f);
final Color red = const Color(0xffc10e0e);
final Color white = const Color(0xffffffff);
final Color gray = const Color(0xffa5a6ae);
final Color lightGray = const Color(0xfff7f7f7);
final Color darkGray = const Color(0xff676870);
final Color black = const Color(0xff020306);
final Color azure = const Color(0xff27928d);
final Color blackSqueeze = const Color(0xffF6F9FC);
final Color sun = const Color(0xffF9B916);
}
| 0 |
mirrored_repositories/crm_app/lib/core/init/theme | mirrored_repositories/crm_app/lib/core/init/theme/dark/text_theme_dark.dart | import 'package:flutter/material.dart';
class TextThemeDark {
static TextThemeDark? _instance;
static TextThemeDark get instance {
if (_instance != null) {
return _instance!;
} else {
_instance = TextThemeDark.init();
return _instance!;
}
}
TextThemeDark.init();
TextTheme get textTheme => const TextTheme(
//XX
headline1: TextStyle(
color: Color(0xfffafafa),
fontSize: 35,
fontWeight: FontWeight.bold,
fontStyle: FontStyle.normal,
),
headline2: TextStyle(
//XX
color: Color(0xfffafafa),
fontSize: 30,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
headline3: TextStyle(
//XX
color: Color(0xfffafafa),
fontSize: 25,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
headline4: TextStyle(
//XX
color: Color(0xfffafafa),
fontSize: 20,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
headline5: TextStyle(
//XX
color: Color(0xfffafafa),
fontSize: 15,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
headline6: TextStyle(
//XX
color: Color(0xfffafafa),
fontSize: 12,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
subtitle1: TextStyle(
color: Color(0xfffafafa),
fontSize: 15,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
bodyText1: TextStyle(
color: Color(0xfffafafa),
fontSize: 18,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
bodyText2: TextStyle(
color: Color(0xffffffff),
fontSize: 16,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
caption: TextStyle(
color: Color(0xb3ffffff),
fontSize: 14,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
button: TextStyle(
color: Color(0xffffffff),
fontSize: 14,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
subtitle2: TextStyle(
color: Color(0xffffffff),
fontSize: 12,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
overline: TextStyle(
color: Color(0xffffffff),
fontSize: 10,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
);
}
| 0 |
mirrored_repositories/crm_app/lib/core/init/theme | mirrored_repositories/crm_app/lib/core/init/theme/light/color_scheme_light.dart | import 'package:flutter/material.dart';
class ColorSchemeLight {
static ColorSchemeLight? _instance;
static ColorSchemeLight get instance {
if (_instance != null) {
return _instance!;
} else {
_instance = ColorSchemeLight.init();
return _instance!;
}
}
ColorSchemeLight.init();
final Color brown = const Color(0xffa87e6f);
final Color white = const Color(0xffffffff);
final Color athensGray = const Color(0xffF5F6F9);
final Color lightGray = const Color(0xfff7f7f7);
final Color darkGray = const Color(0xff676870);
final Color black = const Color(0xff020306);
final Color azure = const Color(0xff27928d);
final Color blackSqueeze = const Color(0xffF6F9FC);
final Color sun = const Color(0xffF9B916);
final Color limedSpruce = const Color(0xff3C4854);
final Color shamrock = const Color(0xff44CF9C);
final Color doggerBlue = const Color(0xff3283F6);
final Color mandy = const Color(0xffE95C5C);
final Color whisper = const Color(0xffF4F5F9);
final Color royalBlue = const Color(0xff6658DD);
final Color carnation = const Color(0xffF64E60);
final Color finn = const Color(0xff663259);
final Color hummingBird = const Color(0xffC9F7F5);
final Color java = const Color(0xff1BC7C8);
final Color amour = const Color(0xffF4E1F0);
final Color piegonPost = const Color(0xffB5C5DE);
final Color pippin = const Color(0xffFFE2E5);
}
| 0 |
mirrored_repositories/crm_app/lib/core/init/theme | mirrored_repositories/crm_app/lib/core/init/theme/light/ilight_theme.dart | import 'color_scheme_light.dart';
import 'text_theme_light.dart';
abstract class ILightTheme {
ColorSchemeLight colorSchemeLight = ColorSchemeLight.instance;
TextThemeLight textThemeLight = TextThemeLight.instance;
}
| 0 |
mirrored_repositories/crm_app/lib/core/init/theme | mirrored_repositories/crm_app/lib/core/init/theme/light/app_theme_light.dart | import 'package:flutter/material.dart';
import '../iapp_theme.dart';
import 'ilight_theme.dart';
class AppThemeLight extends IAppTheme with ILightTheme {
static AppThemeLight? _instance;
static AppThemeLight get instance {
if (_instance != null) {
return _instance!;
} else {
_instance = AppThemeLight.init();
return _instance!;
}
}
AppThemeLight.init();
@override
ThemeData get themeDataLight => ThemeData.light().copyWith(
colorScheme: _colorScheme,
textTheme: textThemeLight.textTheme,
tabBarTheme: TabBarTheme(
labelColor: Colors.black,
unselectedLabelColor: colorSchemeLight.white,
),
bottomAppBarTheme: BottomAppBarTheme(
color: colorSchemeLight.athensGray,
elevation: 0
),
appBarTheme: AppBarTheme(
color: colorSchemeLight.carnation,
titleTextStyle: const TextStyle(fontSize: 18),
),
scaffoldBackgroundColor: colorSchemeLight.athensGray,
);
ColorScheme get _colorScheme => ColorScheme(
primary: colorSchemeLight.black,
primaryVariant: colorSchemeLight.mandy,
secondary: colorSchemeLight.athensGray,
secondaryVariant: colorSchemeLight.limedSpruce,
surface: colorSchemeLight.doggerBlue, //xxß
background: colorSchemeLight.finn, //xx
error: colorSchemeLight.sun,
onPrimary: colorSchemeLight.shamrock,
onSecondary: Colors.black, //x
onSurface: Colors.white,
onBackground: colorSchemeLight.carnation,
onError: colorSchemeLight.royalBlue, //xx
brightness: Brightness.light);
}
| 0 |
mirrored_repositories/crm_app/lib/core/init/theme | mirrored_repositories/crm_app/lib/core/init/theme/light/text_theme_light.dart | import 'package:flutter/material.dart';
class TextThemeLight {
static TextThemeLight? _instance;
static TextThemeLight get instance {
if (_instance != null) {
return _instance!;
} else {
_instance = TextThemeLight.init();
return _instance!;
}
}
TextThemeLight.init();
TextTheme get textTheme => const TextTheme(
//XX
headline1: TextStyle(
color: Color(0xff3C4854),
fontSize: 35,
fontWeight: FontWeight.bold,
fontStyle: FontStyle.normal,
),
headline2: TextStyle(
//XX
color: Color(0xff3C4854),
fontSize: 30,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
headline3: TextStyle(
//XX
color: Color(0xff3C4854),
fontSize: 25,
fontWeight: FontWeight.bold,
fontStyle: FontStyle.normal,
),
headline4: TextStyle(
//XX
color: Color(0xff3C4854),
fontSize: 20,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
headline5: TextStyle(
//XX
color: Color(0xff3C4854),
fontSize: 15,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
headline6: TextStyle(
//XX
color: Color(0xff3C4854),
fontSize: 12,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
subtitle1: TextStyle(
color: Color(0xff3C4854),
fontSize: 15,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
bodyText1: TextStyle(
color: Color(0xff3C4854),
fontSize: 20,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
bodyText2: TextStyle(
color: Color(0xff3C4854),
fontSize: 16,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
caption: TextStyle(
color: Color(0xff3C4854),
fontSize: 14,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
button: TextStyle(
color: Color(0xff3C4854),
fontSize: 16,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
subtitle2: TextStyle(
color: Color(0xff3C4854),
fontSize: 12,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
overline: TextStyle(
color: Color(0xff3C4854),
fontSize: 10,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
);
}
| 0 |
mirrored_repositories/crm_app/lib/core | mirrored_repositories/crm_app/lib/core/cache/cache_manager.dart | // ignore_for_file: constant_identifier_names
import 'package:shared_preferences/shared_preferences.dart';
mixin CacheManager {
Future<bool> saveToken({required String token}) async {
SharedPreferences prefs = await SharedPreferences.getInstance();
await prefs.setString(CacheManagerKey.TOKEN.toString(), token);
return true;
}
Future<String?> getToken() async {
SharedPreferences prefs = await SharedPreferences.getInstance();
return prefs.getString(CacheManagerKey.TOKEN.toString());
}
}
enum CacheManagerKey { TOKEN } | 0 |
mirrored_repositories/crm_app/lib/core/components | mirrored_repositories/crm_app/lib/core/components/snackbar/default_snackbar.dart | import 'package:flutter/material.dart';
import 'package:kartal/kartal.dart';
import '../text/body_text2_copy.dart';
class DefaultSnackBar extends StatelessWidget {
const DefaultSnackBar({Key? key, required this.data}) : super(key: key);
final String data;
@override
Widget build(BuildContext context) {
return SnackBar(
backgroundColor: context.colorScheme.secondaryVariant,
content: BodyText2Copy(
data: data,
color: context.colorScheme.onSurface,
),
);
}
}
| 0 |
mirrored_repositories/crm_app/lib/core/components | mirrored_repositories/crm_app/lib/core/components/card/card_icon_text.dart | import 'package:flutter/material.dart';
import 'package:kartal/kartal.dart';
import '../row/row_icon_text.dart';
class CardIconText extends StatelessWidget {
const CardIconText({Key? key, required this.cardColor, required this.text, required this.icon}) : super(key: key);
final Color cardColor;
final String text;
final IconData icon;
@override
Widget build(BuildContext context) {
return Card(
color: cardColor,
elevation: 0,
child: Padding(
padding: context.paddingLow,
child: RowIconText(
icon: icon,
text: text,
color: context.colorScheme.onSurface,
),
),
);
}
}
| 0 |
mirrored_repositories/crm_app/lib/core/components | mirrored_repositories/crm_app/lib/core/components/text/bold_text.dart | import 'package:flutter/material.dart';
class BoldText extends StatelessWidget {
const BoldText({Key? key, required this.data}) : super(key: key);
final String data;
@override
Widget build(BuildContext context) {
return Text(
data,
style: const TextStyle(fontWeight: FontWeight.bold),
);
}
}
| 0 |
mirrored_repositories/crm_app/lib/core/components | mirrored_repositories/crm_app/lib/core/components/text/body_text2_copy.dart | import 'package:flutter/material.dart';
import 'package:kartal/kartal.dart';
class BodyText2Copy extends StatelessWidget {
const BodyText2Copy({Key? key, required this.data, this.color,this.fontWeight}) : super(key: key);
final String data;
final Color? color;
final FontWeight? fontWeight;
@override
Widget build(BuildContext context) {
return Text(
data,
style: context.textTheme.bodyText2!.copyWith(color: color,fontWeight: fontWeight),
);
}
}
| 0 |
mirrored_repositories/crm_app/lib/core/components | mirrored_repositories/crm_app/lib/core/components/text/subtitle1_copy.dart | import 'package:flutter/material.dart';
import 'package:kartal/kartal.dart';
class Subtitle1Copy extends StatelessWidget {
const Subtitle1Copy({Key? key, required this.data, this.color}) : super(key: key);
final String data;
final Color? color;
@override
Widget build(BuildContext context) {
return Text(
data,
style: context.textTheme.subtitle1!.copyWith(color: color),
);
}
} | 0 |
mirrored_repositories/crm_app/lib/core/components | mirrored_repositories/crm_app/lib/core/components/text/body_text1_copy.dart | import 'package:flutter/material.dart';
import 'package:kartal/kartal.dart';
class BodyText1Copy extends StatelessWidget {
const BodyText1Copy(
{Key? key, required this.data, this.color, this.fontWeight})
: super(key: key);
final String data;
final Color? color;
final FontWeight? fontWeight;
@override
Widget build(BuildContext context) {
return Text(
data,
style: context.textTheme.bodyText1!
.copyWith(color: color, fontWeight: fontWeight),
);
}
}
| 0 |
mirrored_repositories/crm_app/lib/core/components | mirrored_repositories/crm_app/lib/core/components/row/row_flag_text.dart | import 'package:flutter/material.dart';
import 'package:kartal/kartal.dart';
class RowFlagText extends StatelessWidget {
const RowFlagText({Key? key, required this.url, required this.text})
: super(key: key);
final String url;
final String text;
@override
Widget build(BuildContext context) {
return Row(
children: [
Image.network(
url,
width: 24,
),
context.emptySizedWidthBoxLow3x,
Text(
text,
),
],
);
}
}
| 0 |
mirrored_repositories/crm_app/lib/core/components | mirrored_repositories/crm_app/lib/core/components/row/row_space_between_text.dart | import 'package:flutter/material.dart';
class RowSpaceBetweenText extends StatelessWidget {
//const RowSpaceBetweenText({Key? key}) : super(key: key);
final String firstText;
final String secondText;
final String thirthText;
const RowSpaceBetweenText(
{Key? key, required this.firstText, required this.secondText,required this.thirthText})
: super(key: key);
@override
Widget build(BuildContext context) {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
// ignore: prefer_const_literals_to_create_immutables
children: [
Text(
firstText,
),
Text(
"$secondText/$thirthText",
),
],
);
}
}
| 0 |
mirrored_repositories/crm_app/lib/core/components | mirrored_repositories/crm_app/lib/core/components/row/row_circle_avatar.dart | import 'package:flutter/material.dart';
import 'package:kartal/kartal.dart';
class RowCircleAvatar extends StatelessWidget {
//const RowCircleAvatar({Key? key}) : super(key: key);
final String firstText;
final String secondText;
const RowCircleAvatar(
{Key? key, required this.firstText, required this.secondText})
: super(key: key);
@override
Widget build(BuildContext context) {
return Row(
children: [
CircleAvatar(
child: Text(firstText),
),
context.emptySizedWidthBoxLow,
CircleAvatar(
child: Text(secondText),
),
],
);
}
}
| 0 |
mirrored_repositories/crm_app/lib/core/components | mirrored_repositories/crm_app/lib/core/components/row/row_icon_text.dart | import 'package:flutter/material.dart';
import 'package:kartal/kartal.dart';
class RowIconText extends StatelessWidget {
const RowIconText(
{Key? key,
required this.icon,
required this.text,
this.color,
this.sizedBox})
: super(key: key);
final IconData icon;
final String text;
final Color? color;
final SizedBox? sizedBox;
@override
Widget build(BuildContext context) {
return Row(
children: [
Icon(
icon,
color: color ?? context.colorScheme.secondaryVariant,
),
sizedBox ?? context.emptySizedWidthBoxLow3x,
Text(
text,
style: TextStyle(color: color),
),
],
);
}
}
| 0 |
mirrored_repositories/crm_app/lib/core/base | mirrored_repositories/crm_app/lib/core/base/view/base_view.dart | import 'package:flutter/material.dart';
import 'package:mobx/mobx.dart';
class BaseView<T extends Store> extends StatefulWidget {
final T viewModel;
final Function(T model)? onModelReady;
final VoidCallback? onDispose;
final Widget Function(BuildContext context, T value) onPageBuilder;
const BaseView(
{Key? key,
required this.viewModel,
this.onModelReady,
this.onDispose,
required this.onPageBuilder})
: super(key: key);
@override
_BaseViewState createState() => _BaseViewState();
}
class _BaseViewState extends State<BaseView> {
@override
void initState() {
super.initState();
if (widget.onModelReady != null) widget.onModelReady!(widget.viewModel);
}
@override
void dispose() {
super.dispose();
if (widget.onDispose != null) widget.onDispose!();
}
@override
Widget build(BuildContext context) {
return widget.onPageBuilder(context, widget.viewModel);
}
}
| 0 |
mirrored_repositories/crm_app/lib/core/base | mirrored_repositories/crm_app/lib/core/base/state/base_state.dart | import 'package:flutter/material.dart';
abstract class BaseState<T extends StatefulWidget> extends State<T> {
ThemeData get themeData => Theme.of(context);
double dynamicHeight(double value) =>
MediaQuery.of(context).size.height * value;
double dynamicWidth(double value) =>
MediaQuery.of(context).size.width * value;
}
| 0 |
mirrored_repositories/crm_app/lib/product/widgets | mirrored_repositories/crm_app/lib/product/widgets/kanban/kanban.dart |
// ignore_for_file: avoid_function_literals_in_foreach_calls, unnecessary_new, prefer_const_constructors, avoid_print
import 'package:flutter/material.dart';
import 'package:flutter_html/flutter_html.dart';
class MyHomePage extends StatefulWidget {
const MyHomePage({Key? key, required this.title}) : super(key: key);
final String title;
@override
_MyHomePageState createState() => _MyHomePageState();
}
const htmlData = r"""
<p id='top'><a href='#bottom'>Scroll to bottom</a></p>
<h1>Header 1</h1>
<h2>Header 2</h2>
<h3>Header 3</h3>
<h4>Header 4</h4>
<h5>Header 5</h5>
<h6>Header 6</h6>
<h3>Ruby Support:</h3>
<p>
<ruby>
漢<rt>かん</rt>
字<rt>じ</rt>
</ruby>
is Japanese Kanji.
</p>
<h3>Support for maxLines:</h3>
<h5>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec vestibulum sapien feugiat lorem tempor, id porta orci elementum. Fusce sed justo id arcu egestas congue. Fusce tincidunt lacus ipsum, in imperdiet felis ultricies eu. In ullamcorper risus felis, ac maximus dui bibendum vel. Integer ligula tortor, facilisis eu mauris ut, ultrices hendrerit ex. Donec scelerisque massa consequat, eleifend mauris eu, mollis dui. Donec placerat augue tortor, et tincidunt quam tempus non. Quisque sagittis enim nisi, eu condimentum lacus egestas ac. Nam facilisis luctus ipsum, at aliquam urna fermentum a. Quisque tortor dui, faucibus in ante eget, pellentesque mattis nibh. In augue dolor, euismod vitae eleifend nec, tempus vel urna. Donec vitae augue accumsan ligula fringilla ultrices et vel ex.</h5>
<h3>Support for <code>sub</code>/<code>sup</code></h3>
Solve for <var>x<sub>n</sub></var>: log<sub>2</sub>(<var>x</var><sup>2</sup>+<var>n</var>) = 9<sup>3</sup>
<p>One of the most <span>common</span> equations in all of physics is <br /><var>E</var>=<var>m</var><var>c</var><sup>2</sup>.</p>
<h3>Inline Styles:</h3>
<p>The should be <span style='color: blue;'>BLUE style='color: blue;'</span></p>
<p>The should be <span style='color: red;'>RED style='color: red;'</span></p>
<p>The should be <span style='color: rgba(0, 0, 0, 0.10);'>BLACK with 10% alpha style='color: rgba(0, 0, 0, 0.10);</span></p>
<p>The should be <span style='color: rgb(0, 97, 0);'>GREEN style='color: rgb(0, 97, 0);</span></p>
<p>The should be <span style='background-color: red; color: rgb(0, 97, 0);'>GREEN style='color: rgb(0, 97, 0);</span></p>
<p style="text-align: center;"><span style="color: rgba(0, 0, 0, 0.95);">blasdafjklasdlkjfkl</span></p>
<p style="text-align: right;"><span style="color: rgba(0, 0, 0, 0.95);">blasdafjklasdlkjfkl</span></p>
<p style="text-align: justify;"><span style="color: rgba(0, 0, 0, 0.95);">blasdafjklasdlkjfkl</span></p>
<p style="text-align: center;"><span style="color: rgba(0, 0, 0, 0.95);">blasdafjklasdlkjfkl</span></p>
<h3>Table support (with custom styling!):</h3>
<p>
<q>Famous quote...</q>
</p>
<table>
<colgroup>
<col width="50%" />
<col span="2" width="25%" />
</colgroup>
<thead>
<tr><th>One</th><th>Two</th><th>Three</th></tr>
</thead>
<tbody>
<tr>
<td rowspan='2'>Rowspan\nRowspan\nRowspan\nRowspan\nRowspan\nRowspan\nRowspan\nRowspan\nRowspan\nRowspan</td><td>Data</td><td>Data</td>
</tr>
<tr>
<td colspan="2"><img alt='Google' src='https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_92x30dp.png' /></td>
</tr>
</tbody>
<tfoot>
<tr><td>fData</td><td>fData</td><td>fData</td></tr>
</tfoot>
</table>
<h3>Custom Element Support (inline: <bird></bird> and as block):</h3>
<flutter></flutter>
<flutter horizontal></flutter>
<h3 id='middle'>SVG support:</h3>
<svg id='svg1' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'>
<circle r="32" cx="35" cy="65" fill="#F00" opacity="0.5"/>
<circle r="32" cx="65" cy="65" fill="#0F0" opacity="0.5"/>
<circle r="32" cx="50" cy="35" fill="#00F" opacity="0.5"/>
</svg>
<h3>List support:</h3>
<ol>
<li>This</li>
<li><p>is</p></li>
<li>an</li>
<li>
ordered
<ul>
<li>With<br /><br />...</li>
<li>a</li>
<li>nested</li>
<li>unordered
<ol style="list-style-type: lower-alpha;" start="5">
<li>With a nested</li>
<li>ordered list</li>
<li>with a lower alpha list style</li>
<li>starting at letter e</li>
</ol>
</li>
<li>list</li>
</ul>
</li>
<li>list! Lorem ipsum dolor sit amet.</li>
<li><h2>Header 2</h2></li>
<h2><li>Header 2</li></h2>
</ol>
<h3>Link support:</h3>
<p>
Linking to <a href='https://github.com'>websites</a> has never been easier.
</p>
<h3>Image support:</h3>
<h3>Network png</h3>
<img alt='Google' src='https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_92x30dp.png' />
<h3>Network svg</h3>
<img src='https://dev.w3.org/SVG/tools/svgweb/samples/svg-files/android.svg' />
<h3>Local asset png</h3>
<img src='asset:assets/html5.png' width='100' />
<h3>Local asset svg</h3>
<img src='asset:assets/mac.svg' width='100' />
<h3>Data uri (with base64 support)</h3>
<img alt='Red dot (png)' src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==' />
<img alt='Green dot (base64 svg)' src='data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB2aWV3Qm94PSIwIDAgMzAgMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxjaXJjbGUgY3g9IjE1IiBjeT0iMTAiIHI9IjEwIiBmaWxsPSJncmVlbiIvPgo8L3N2Zz4=' />
<img alt='Green dot (plain svg)' src='data:image/svg+xml,%3C?xml version="1.0" encoding="UTF-8"?%3E%3Csvg viewBox="0 0 30 20" xmlns="http://www.w3.org/2000/svg"%3E%3Ccircle cx="15" cy="10" r="10" fill="yellow"/%3E%3C/svg%3E' />
<h3>Custom source matcher (relative paths)</h3>
<img src='/wikipedia/commons/thumb/e/ef/Octicons-logo-github.svg/200px-Octicons-logo-github.svg.png' />
<h3>Custom image render (flutter.dev)</h3>
<img src='https://flutter.dev/images/flutter-mono-81x100.png' />
<h3>No image source</h3>
<img alt='No source' />
<img alt='Empty source' src='' />
<h3>Broken network image</h3>
<img alt='Broken image' src='https://www.notgoogle.com/images/branding/googlelogo/2x/googlelogo_color_92x30dp.png' />
<h3>MathML Support:</h3>
<math>
<mrow>
<mi>x</mi>
<mo>=</mo>
<mfrac>
<mrow>
<mrow>
<mo>-</mo>
<mi>b</mi>
</mrow>
<mo>±</mo>
<msqrt>
<mrow>
<msup>
<mi>b</mi>
<mn>2</mn>
</msup>
<mo>-</mo>
<mrow>
<mn>4</mn>
<mo>⁢</mo>
<mi>a</mi>
<mo>⁢</mo>
<mi>c</mi>
</mrow>
</mrow>
</msqrt>
</mrow>
<mrow>
<mn>2</mn>
<mo>⁢</mo>
<mi>a</mi>
</mrow>
</mfrac>
</mrow>
</math>
<math>
<munderover >
<mo> ∫ </mo>
<mn> 0 </mn>
<mi> 5 </mi>
</munderover>
<msup>
<mi>x</mi>
<mn>2</mn>
</msup>
<mo>⋅</mo>
<mi>ⅆ</mi><mi>x</mi>
<mo>=</mo>
<mo>[</mo>
<mfrac>
<mn>1</mn>
<mi>3</mi>
</mfrac>
<msup>
<mi>x</mi>
<mn>3</mn>
</msup>
<msubsup>
<mo>]</mo>
<mn>0</mn>
<mn>5</mn>
</msubsup>
<mo>=</mo>
<mfrac>
<mn>125</mn>
<mi>3</mi>
</mfrac>
<mo>-</mo>
<mn>0</mn>
<mo>=</mo>
<mfrac>
<mn>125</mn>
<mi>3</mi>
</mfrac>
</math>
<math>
<msup>
<mo>sin</mo>
<mn>2</mn>
</msup>
<mo>θ</mo>
<mo>+</mo>
<msup>
<mo>cos</mo>
<mn>2</mn>
</msup>
<mo>θ</mo>
<mo>=</mo>
<mn>1</mn>
</math>
<h3>Tex Support with the custom tex tag:</h3>
<tex>i\hbar\frac{\partial}{\partial t}\Psi(\vec x,t) = -\frac{\hbar}{2m}\nabla^2\Psi(\vec x,t)+ V(\vec x)\Psi(\vec x,t)</tex>
<p id='bottom'><a href='#top'>Scroll to top</a></p>
""";
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: AppBar(
title: Text('flutter_html Example'),
centerTitle: true,
),
body: SingleChildScrollView(
child: Html(
data: htmlData,
style: {
"table": Style(
backgroundColor: Color.fromARGB(0x50, 0xee, 0xee, 0xee),
),
"tr": Style(
border: Border(bottom: BorderSide(color: Colors.grey)),
),
"th": Style(
padding: EdgeInsets.all(6),
backgroundColor: Colors.grey,
),
"td": Style(
padding: EdgeInsets.all(6),
alignment: Alignment.topLeft,
),
'h5': Style(maxLines: 2, textOverflow: TextOverflow.ellipsis),
},
customRender: {
"table": (context, child) {
return SingleChildScrollView(
scrollDirection: Axis.horizontal,
child:
(context.tree as TableLayoutElement).toWidget(context),
);
},
"bird": (RenderContext context, Widget child) {
return TextSpan(text: "🐦");
},
"flutter": (RenderContext context, Widget child) {
return FlutterLogo(
style: (context.tree.element!.attributes['horizontal'] != null)
? FlutterLogoStyle.horizontal
: FlutterLogoStyle.markOnly,
textColor: context.style.color!,
size: context.style.fontSize!.size! * 5,
);
},
},
customImageRenders: {
networkSourceMatcher(domains: ["flutter.dev"]):
(context, attributes, element) {
return FlutterLogo(size: 36);
},
networkSourceMatcher(domains: ["mydomain.com"]):
networkImageRender(
headers: {"Custom-Header": "some-value"},
altWidget: (alt) => Text(alt ?? ""),
loadingWidget: () => Text("Loading..."),
),
// On relative paths starting with /wiki, prefix with a base url
(attr, _) =>
attr["src"] != null && attr["src"]!.startsWith("/wiki"):
networkImageRender(
mapUrl: (url) => "https://upload.wikimedia.org" + url!),
// Custom placeholder image for broken links
networkSourceMatcher():
networkImageRender(altWidget: (_) => FlutterLogo()),
},
onLinkTap: (url, _, __, ___) {
print("Opening $url...");
},
onImageTap: (src, _, __, ___) {
print(src);
},
onImageError: (exception, stackTrace) {
print(exception);
},
onCssParseError: (css, messages) {
print("css that errored: $css");
print("error messages:");
messages.forEach((element) {
print(element);
});
},
),
),
);
}
} | 0 |
mirrored_repositories/crm_app/lib/product/widgets | mirrored_repositories/crm_app/lib/product/widgets/fabbutton/add_fab_button.dart | import 'package:flutter/material.dart';
import 'package:kartal/kartal.dart';
class AddFabButton extends StatelessWidget {
const AddFabButton({ Key? key, required this.tooltip }) : super(key: key);
final String tooltip;
@override
Widget build(BuildContext context) {
return Padding(
padding: context.verticalPaddingMedium,
child: FloatingActionButton(
onPressed: () {},
child: Icon(
Icons.add,
color: context.colorScheme.onSurface,
),
backgroundColor: context.colorScheme.onPrimary,
elevation: 0,
tooltip: tooltip,
),
);
}
} | 0 |
mirrored_repositories/crm_app/lib/product/widgets | mirrored_repositories/crm_app/lib/product/widgets/card/check_box_card_v2.dart | // ignore_for_file: prefer_const_constructors
import 'package:crm_app/core/constants/app/app_constants.dart';
import 'package:flutter/material.dart';
import 'package:kartal/kartal.dart';
class CheckBoxCardV2 extends StatefulWidget {
final bool isSelect;
final String data;
final String userId;
const CheckBoxCardV2(
{Key? key,
required this.isSelect,
required this.data,
required this.userId})
: super(key: key);
@override
_CheckBoxCardState createState() => _CheckBoxCardState();
}
class _CheckBoxCardState extends State<CheckBoxCardV2> {
bool isSelected = false;
String userId = "";
String dropdownValue = '1';
@override
void initState() {
super.initState();
isSelected = widget.isSelect;
userId = widget.userId;
}
@override
Widget build(BuildContext context) {
return Column(
children: [
Card(
color: isSelected ? Colors.green[100] : context.colorScheme.secondary,
elevation: 5,
child: CheckboxListTile(
value: isSelected,
onChanged: (value) {
setState(() => isSelected = value!);
if (isSelected) {
ApplicationConstants.instance!.userId.add(userId);
} else {
ApplicationConstants.instance!.userId.remove(userId);
}
},
title: Wrap(
crossAxisAlignment: WrapCrossAlignment.center,
spacing: 15,
children: [
Text("Erişim seviyesi"),
DropdownButton<String>(
value: dropdownValue,
onChanged: (String? newValue) {
setState(() {
dropdownValue = newValue!;
ApplicationConstants.instance!.accessLevel.add(dropdownValue);
});
},
items: <String>['1', '2', '3']
.map<DropdownMenuItem<String>>((String value) {
return DropdownMenuItem<String>(
value: value,
child: Text(value),
);
}).toList(),
),
],
),
secondary: SizedBox(
width: context.dynamicWidth(0.4),
child: Row(
// ignore: prefer_const_literals_to_create_immutables
children: [
Icon(Icons.person),
context.emptySizedWidthBoxLow3x,
Text(widget.data)
],
),
),
activeColor: context.colorScheme.onPrimary,
),
),
context.emptySizedHeightBoxLow,
],
);
}
}
| 0 |
mirrored_repositories/crm_app/lib/product/widgets | mirrored_repositories/crm_app/lib/product/widgets/card/check_box_card.dart | import 'package:flutter/material.dart';
import 'package:kartal/kartal.dart';
import '../../../core/constants/app/app_constants.dart';
class CheckBoxCard extends StatefulWidget {
final bool isSelect;
final String data;
final String? guiId;
final String? userId;
final Widget? child;
const CheckBoxCard(
{Key? key,
required this.isSelect,
required this.data,
this.guiId,
this.userId,
this.child})
: super(key: key);
@override
_CheckBoxCardState createState() => _CheckBoxCardState();
}
class _CheckBoxCardState extends State<CheckBoxCard> {
bool isSelected = false;
String guiId = "";
String userId = "";
@override
void initState() {
super.initState();
isSelected = widget.isSelect;
guiId = widget.guiId ?? "0";
userId = widget.userId ?? "0";
}
@override
Widget build(BuildContext context) {
return Column(
children: [
Card(
color: isSelected ? Colors.green[100] : context.colorScheme.secondary,
elevation: 5,
child: Column(
children: [
CheckboxListTile(
value: isSelected,
onChanged: (value) {
setState(() => isSelected = value!);
if (isSelected) {
ApplicationConstants.instance!.guiId.add(guiId);
ApplicationConstants.instance!.userId.add(userId);
} else {
ApplicationConstants.instance!.guiId.remove(guiId);
ApplicationConstants.instance!.userId.remove(userId);
}
},
title: Text(widget.data),
secondary: const Icon(Icons.person),
activeColor: context.colorScheme.onPrimary,
),
isSelected
? widget.child ?? context.emptySizedHeightBoxLow
: context.emptySizedHeightBoxLow,
],
),
),
context.emptySizedHeightBoxLow,
],
);
}
}
| 0 |
mirrored_repositories/crm_app/lib/product/widgets | mirrored_repositories/crm_app/lib/product/widgets/divider/blue_divider.dart | import 'package:flutter/material.dart';
import 'package:kartal/kartal.dart';
class BlueDivider extends StatelessWidget {
const BlueDivider({Key? key,required this.width}) : super(key: key);
final double width;
@override
Widget build(BuildContext context) {
return Divider(
thickness: 15,
color: context.colorScheme.surface,
endIndent: context.dynamicWidth(width),
);
}
}
| 0 |
mirrored_repositories/crm_app/lib/product/widgets | mirrored_repositories/crm_app/lib/product/widgets/stack/blue_bar.dart | import 'package:flutter/material.dart';
import '../divider/blue_divider.dart';
class BlueBar extends StatelessWidget {
const BlueBar({Key? key, required this.width}) : super(key: key);
final double width;
@override
Widget build(BuildContext context) {
return Stack(
// ignore: prefer_const_literals_to_create_immutables
children: [
const Divider(
thickness: 15,
),
BlueDivider(width: width)
],
);
}
}
| 0 |
mirrored_repositories/crm_app/lib/product/widgets | mirrored_repositories/crm_app/lib/product/widgets/dismissible/delete_dismissible.dart | import 'package:flutter/material.dart';
import 'package:kartal/kartal.dart';
class DeleteDismissible<T> extends StatelessWidget {
final Widget child;
const DeleteDismissible({Key? key, required this.child})
: super(key: key);
@override
Widget build(BuildContext context) {
return Dismissible(
key: UniqueKey(),
child: child,
background: _buildSwipeActionRight(context),
direction: DismissDirection.endToStart,
);
}
Widget _buildSwipeActionRight(BuildContext context) => Container(
alignment: Alignment.centerRight,
padding: context.horizontalPaddingNormal,
color: context.colorScheme.primaryVariant,
child: Icon(
Icons.delete_forever,
color: context.colorScheme.onSurface,
size: context.dynamicWidth(0.08),
),
);
}
| 0 |
mirrored_repositories/crm_app/lib/product/widgets | mirrored_repositories/crm_app/lib/product/widgets/row/row_cavatar_text.dart | import 'package:flutter/material.dart';
import 'package:kartal/kartal.dart';
import '../../../core/components/text/body_text2_copy.dart';
class RowCavatarText extends StatelessWidget {
const RowCavatarText({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Row(
// ignore: prefer_const_literals_to_create_immutables
children: [
const CircleAvatar(
child: Text("AK"),
),
context.emptySizedWidthBoxLow3x,
BodyText2Copy(
data: "Ahmet Kaan Uzman", color: context.colorScheme.onSurface)
],
);
}
}
| 0 |
mirrored_repositories/crm_app/lib/product/widgets | mirrored_repositories/crm_app/lib/product/widgets/switch_list_tile/switch_list_tile.dart | import 'package:flutter/material.dart';
class DefaultSwitchListTile extends StatelessWidget {
const DefaultSwitchListTile(
{Key? key, required this.value, this.onChanged, required this.child})
: super(key: key);
final bool value;
final Function(bool)? onChanged;
final Widget child;
@override
Widget build(BuildContext context) {
return SwitchListTile(
value: value,
onChanged: (value) {
onChanged;
},
title: child);
}
}
| 0 |
mirrored_repositories/crm_app/lib/product | mirrored_repositories/crm_app/lib/product/model/kanban_model.dart | // ignore_for_file: unnecessary_this
class BoardItemObject{
String? title;
BoardItemObject({this.title}){
if(this.title == null){
this.title = "";
}
}
}
class BoardListObject{
String? title;
List<BoardItemObject>? items;
BoardListObject({this.title,this.items}){
if(this.title == null){
this.title = "";
}
if(this.items == null){
this.items = [];
}
}
} | 0 |
mirrored_repositories/crm_app/lib/feature/auth/reset_pass | mirrored_repositories/crm_app/lib/feature/auth/reset_pass/view/reset_pass_view.dart | // ignore_for_file: must_be_immutable
import 'dart:convert';
import 'package:cool_alert/cool_alert.dart';
import 'package:crm_app/core/components/text/body_text2_copy.dart';
import 'package:crm_app/feature/auth/login/view/login_view.dart';
import 'package:crm_app/feature/auth/reset_pass/viewmodel/reset_pass_view_model.dart';
import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:flutter_mobx/flutter_mobx.dart';
import 'package:kartal/kartal.dart';
class ResetPass extends StatelessWidget {
final ResetPassViewModel _viewModel = ResetPassViewModel();
final _formKey = GlobalKey<FormState>();
var emailController = TextEditingController();
var passController = TextEditingController();
String verificationCode = "";
ResetPass({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
body: Padding(
padding: context.paddingNormal,
child: Form(
key: _formKey,
autovalidateMode: AutovalidateMode.always,
child: Observer(
builder: (context) => SingleChildScrollView(
physics: const BouncingScrollPhysics(),
child: SizedBox(
height: context.dynamicHeight(1.2),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Center(
child: Image.network(
"http://192.168.3.53/assets/images/logo-dark.png")),
context.emptySizedHeightBoxLow3x,
const Text("Şifrenizi mi unuttunuz ?"),
context.emptySizedHeightBoxNormal,
Padding(
padding: context.paddingLow,
child: const Text("Email"),
),
TextField(
controller: emailController,
keyboardType: TextInputType.emailAddress,
decoration: InputDecoration(
suffixIcon: SizedBox(
height: context.dynamicHeight(0.07),
child: ElevatedButton(
onPressed: () async {
CoolAlert.show(
context: context,
type: CoolAlertType.info,
title: "",
text:
'Şifre sıfırlama isteğiniz başarılı !\n Lütfen mail adresinize gelen doğrulama kodunu giriniz.',
confirmBtnText: "Tamam",
loopAnimation: false,
confirmBtnColor: context.colorScheme.onPrimary,
);
Dio dio = Dio();
final response = await dio.get(
"http://192.168.3.53/api/Foreign/lost_key?email=${emailController.text}");
final mapVerificationCode =
jsonDecode(response.data);
verificationCode =
mapVerificationCode['dogrulama'].toString();
debugPrint(verificationCode);
_viewModel.openToClose();
},
child: Text(
"Doğrula",
style: TextStyle(
color: context.colorScheme.onSurface),
),
style: ElevatedButton.styleFrom(
primary: context.colorScheme.secondaryVariant),
),
),
filled: true,
prefixIcon: const Icon(Icons.email),
hintText: 'Emaili giriniz.',
labelText: "Email",
enabledBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide: BorderSide(
color: context.colorScheme.onBackground),
),
focusedBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide:
BorderSide(color: context.colorScheme.surface),
),
),
cursorColor: context.colorScheme.onSecondary,
),
context.emptySizedHeightBoxLow3x,
AnimatedOpacity(
opacity: _viewModel.isOpen ? 1.0 : 0.0,
duration: context.durationLow,
child: TextFormField(
keyboardType: TextInputType.emailAddress,
decoration: InputDecoration(
suffixIcon: IconButton(
onPressed: () {
if (_formKey.currentState!.validate()) {
_viewModel.closeToOpen();
}
},
icon: const Icon(Icons.next_plan)),
filled: true,
prefixIcon: const Icon(Icons.check_circle),
hintText: 'Doğrulama kodunu giriniz.',
labelText: "Doğrulama kodu",
enabledBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide: BorderSide(
color: context.colorScheme.onBackground),
),
focusedBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide:
BorderSide(color: context.colorScheme.surface),
),
focusedErrorBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide: const BorderSide(color: Colors.red),
),
),
cursorColor: context.colorScheme.onSecondary,
validator: (value) {
if (verificationCode != value) {
return 'Geçersiz doğrulama kodu !';
}
},
),
),
context.emptySizedHeightBoxLow3x,
AnimatedOpacity(
duration: context.durationLow,
opacity: _viewModel.isClose ? 0.0 : 1.0,
child: Padding(
padding: context.paddingLow,
child: const Text("Yeni Şifre"),
),
),
AnimatedOpacity(
duration: context.durationLow,
opacity: _viewModel.isClose ? 0.0 : 1.0,
child: TextField(
controller: passController,
obscureText: true,
decoration: InputDecoration(
filled: true,
prefixIcon: const Icon(Icons.lock),
hintText: 'Yeni şifrenizi giriniz.',
labelText: "Yeni şifre",
enabledBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide: BorderSide(
color: context.colorScheme.onBackground),
),
focusedBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide:
BorderSide(color: context.colorScheme.surface),
),
),
cursorColor: context.colorScheme.onSecondary,
),
),
context.emptySizedHeightBoxLow3x,
AnimatedOpacity(
duration: context.durationLow,
opacity: _viewModel.isClose ? 0.0 : 1.0,
child: Padding(
padding: context.paddingLow,
child: const Text("Yeni Şifre Kontrol"),
),
),
AnimatedOpacity(
duration: context.durationLow,
opacity: _viewModel.isClose ? 0.0 : 1.0,
child: TextFormField(
validator: (value) {
if (passController.text != value) {
return 'Şifreler birbiriyle uyuşmuyor !';
}
},
obscureText: true,
decoration: InputDecoration(
suffixIcon: IconButton(
onPressed: () {
debugPrint(passController.text);
if (_formKey.currentState!.validate()) {
_viewModel.buttonCloseOrOpen();
}
},
icon: const Icon(Icons.next_plan)),
filled: true,
prefixIcon: const Icon(Icons.lock),
hintText: 'Yeni şifrenizi giriniz.',
labelText: "Yeni şifre",
enabledBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide: BorderSide(
color: context.colorScheme.onBackground),
),
focusedBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide:
BorderSide(color: context.colorScheme.surface),
),
focusedErrorBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide: const BorderSide(color: Colors.red),
),
),
cursorColor: context.colorScheme.onSecondary,
),
),
context.emptySizedHeightBoxLow3x,
AnimatedOpacity(
duration: context.durationLow,
opacity: _viewModel.isButtonClose ? 1.0 : 0.0,
child: SizedBox(
width: double.infinity,
height: context.dynamicHeight(0.065),
child: ElevatedButton(
style: ElevatedButton.styleFrom(
shape: RoundedRectangleBorder(
borderRadius: context.highBorderRadius),
primary: context.colorScheme.onError),
onPressed: () {
Dio dio = Dio();
dio.post(
"http://192.168.3.53/api/Persons/new_pass?email=${emailController.text}&pass=${passController.text}");
CoolAlert.show(
context: context,
type: CoolAlertType.success,
title: "",
text:
'Şifreniz başarıyla değiştirildi !\n Tamam butonuna tıklayıp giriş ekranına gidebilirsiniz.',
confirmBtnText: "Tamam",
loopAnimation: false,
confirmBtnColor: context.colorScheme.onPrimary,
onConfirmBtnTap: () {
Navigator.of(context).push(MaterialPageRoute(
builder: (context) => const LoginView()));
});
},
child: BodyText2Copy(
data: "Şifreyi Değiştir",
color: context.colorScheme.onSurface),
),
),
)
],
),
),
),
),
),
),
);
}
}
| 0 |
mirrored_repositories/crm_app/lib/feature/auth/reset_pass | mirrored_repositories/crm_app/lib/feature/auth/reset_pass/viewmodel/reset_pass_view_model.g.dart | // GENERATED CODE - DO NOT MODIFY BY HAND
part of 'reset_pass_view_model.dart';
// **************************************************************************
// StoreGenerator
// **************************************************************************
// ignore_for_file: non_constant_identifier_names, unnecessary_brace_in_string_interps, unnecessary_lambdas, prefer_expression_function_bodies, lines_longer_than_80_chars, avoid_as, avoid_annotating_with_dynamic
mixin _$ResetPassViewModel on _ResetPassViewModelBase, Store {
final _$isOpenAtom = Atom(name: '_ResetPassViewModelBase.isOpen');
@override
bool get isOpen {
_$isOpenAtom.reportRead();
return super.isOpen;
}
@override
set isOpen(bool value) {
_$isOpenAtom.reportWrite(value, super.isOpen, () {
super.isOpen = value;
});
}
final _$isCloseAtom = Atom(name: '_ResetPassViewModelBase.isClose');
@override
bool get isClose {
_$isCloseAtom.reportRead();
return super.isClose;
}
@override
set isClose(bool value) {
_$isCloseAtom.reportWrite(value, super.isClose, () {
super.isClose = value;
});
}
final _$isButtonCloseAtom =
Atom(name: '_ResetPassViewModelBase.isButtonClose');
@override
bool get isButtonClose {
_$isButtonCloseAtom.reportRead();
return super.isButtonClose;
}
@override
set isButtonClose(bool value) {
_$isButtonCloseAtom.reportWrite(value, super.isButtonClose, () {
super.isButtonClose = value;
});
}
final _$_ResetPassViewModelBaseActionController =
ActionController(name: '_ResetPassViewModelBase');
@override
void openToClose() {
final _$actionInfo = _$_ResetPassViewModelBaseActionController.startAction(
name: '_ResetPassViewModelBase.openToClose');
try {
return super.openToClose();
} finally {
_$_ResetPassViewModelBaseActionController.endAction(_$actionInfo);
}
}
@override
void closeToOpen() {
final _$actionInfo = _$_ResetPassViewModelBaseActionController.startAction(
name: '_ResetPassViewModelBase.closeToOpen');
try {
return super.closeToOpen();
} finally {
_$_ResetPassViewModelBaseActionController.endAction(_$actionInfo);
}
}
@override
void buttonCloseOrOpen() {
final _$actionInfo = _$_ResetPassViewModelBaseActionController.startAction(
name: '_ResetPassViewModelBase.buttonCloseOrOpen');
try {
return super.buttonCloseOrOpen();
} finally {
_$_ResetPassViewModelBaseActionController.endAction(_$actionInfo);
}
}
@override
String toString() {
return '''
isOpen: ${isOpen},
isClose: ${isClose},
isButtonClose: ${isButtonClose}
''';
}
}
| 0 |
mirrored_repositories/crm_app/lib/feature/auth/reset_pass | mirrored_repositories/crm_app/lib/feature/auth/reset_pass/viewmodel/reset_pass_view_model.dart | import 'package:mobx/mobx.dart';
part 'reset_pass_view_model.g.dart';
class ResetPassViewModel = _ResetPassViewModelBase with _$ResetPassViewModel;
abstract class _ResetPassViewModelBase with Store {
@observable
bool isOpen = false;
@observable
bool isClose = true;
@observable
bool isButtonClose = false;
@action
void openToClose() {
isOpen = !isOpen;
}
@action
void closeToOpen() {
isClose = !isClose;
}
@action
void buttonCloseOrOpen() {
isButtonClose = !isButtonClose;
}
}
| 0 |
mirrored_repositories/crm_app/lib/feature/auth/login | mirrored_repositories/crm_app/lib/feature/auth/login/view/login_view.dart | // ignore_for_file: prefer_const_constructors
import 'package:cool_alert/cool_alert.dart';
import 'package:crm_app/core/init/theme/light/color_scheme_light.dart';
import 'package:crm_app/feature/auth/register/view/register_view.dart';
import '../../../../core/cache/cache_manager.dart';
import '../../../../core/constants/app/app_constants.dart';
import 'package:flutter/material.dart';
import 'package:flutter_mobx/flutter_mobx.dart';
import 'package:kartal/kartal.dart';
import '../../../../core/components/text/body_text1_copy.dart';
import '../../../../core/components/text/body_text2_copy.dart';
import '../../../home/bottomtab/view/bottomtab_view.dart';
import '../../reset_pass/view/reset_pass_view.dart';
import '../viewmodel/login_view_model.dart';
class LoginView extends StatefulWidget {
const LoginView({Key? key}) : super(key: key);
@override
State<LoginView> createState() => _LoginViewState();
}
class _LoginViewState extends State<LoginView> with CacheManager {
final LoginViewModel _viewModel = LoginViewModel();
var emailController = TextEditingController();
var passController = TextEditingController();
@override
Widget build(BuildContext context) {
if (_viewModel.context == null) {
_viewModel.setContext(context);
}
return Scaffold(
resizeToAvoidBottomInset: false,
body: Padding(
padding: context.paddingNormal,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Image.network("http://192.168.3.53/assets/images/logo-dark.png"),
context.emptySizedHeightBoxNormal,
Padding(
padding: context.paddingLow,
child: const Text("Email"),
),
TextField(
keyboardType: TextInputType.emailAddress,
controller: emailController,
decoration: InputDecoration(
filled: true,
prefixIcon: const Icon(Icons.email),
hintText: 'Emaili giriniz.',
labelText: "Email",
enabledBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide: BorderSide(color: Colors.grey),
),
focusedBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide: BorderSide(color: context.colorScheme.surface),
),
),
cursorColor: context.colorScheme.onSecondary,
),
context.emptySizedHeightBoxLow3x,
Padding(
padding: context.paddingLow,
child: const Text("Şifre"),
),
TextField(
obscureText: true,
controller: passController,
decoration: InputDecoration(
filled: true,
prefixIcon: const Icon(Icons.lock),
hintText: 'Şifreyi giriniz.',
labelText: "Şifre",
enabledBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide: BorderSide(color: Colors.grey),
),
focusedBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide: BorderSide(color: context.colorScheme.surface),
),
),
cursorColor: context.colorScheme.onSecondary,
),
context.emptySizedHeightBoxLow,
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Align(
alignment: Alignment.centerLeft,
child: Padding(
padding: context.paddingLow,
child: TextButton(
onPressed: () {
Navigator.of(context).push(MaterialPageRoute(
builder: (context) => ResetPass()));
},
child: Text(
"Şifrenizi mi unuttunuz ?",
style: TextStyle(
color: context.colorScheme.surface,
fontWeight: FontWeight.bold),
),
),
),
),
Row(
children: [
Observer(
builder: (_) => Checkbox(
activeColor: context.colorScheme.secondaryVariant,
value: _viewModel.isRememberMe,
onChanged: (value) => _viewModel.changeRememberMe()),
),
Text(
"Beni hatırla",
style: TextStyle(
color: context.colorScheme.secondaryVariant,
fontWeight: FontWeight.bold),
),
],
),
],
),
context.emptySizedHeightBoxLow3x,
SizedBox(
width: double.infinity,
height: context.dynamicHeight(0.065),
child: ElevatedButton(
onPressed: () {
if (_viewModel.item?[1] != null) {
if (_viewModel.item![1] == 'success') {
if (_viewModel.isRememberMe) {
saveToken(
token: _viewModel.item?[0] ??
ApplicationConstants.instance!.token);
}
Navigator.of(context).push(MaterialPageRoute(
builder: (context) => BottomTabView()));
CoolAlert.show(
context: context,
type: CoolAlertType.success,
title: "",
text:
'Doğru kullanıcı adı ve şifre !\n Sisteme başarıyla giriş yapıldı.',
confirmBtnText: "Tamam",
loopAnimation: false,
confirmBtnColor: context.colorScheme.onPrimary,
);
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
backgroundColor: context.colorScheme.secondaryVariant,
duration: context.durationSlow,
content: BodyText2Copy(
data: "Giriş başarılı !",
color: context.colorScheme.onSurface,
),
),
);
} else if (_viewModel.item![1] == 'error') {
_showDialog(
context,
context.lowValue,
"Yanlış kullanıcı adı veya şifre.",
"Lütfen tekrar giriş yapmayı deneyiniz.");
} else if (_viewModel.item![1] == 'null error') {
_showDialog(
context,
context.lowValue,
"Girilmeyen kullanıcı adı veya şifre",
"Lütfen tekrar giriş yapmayı deneyiniz.");
}
} else {
_viewModel.fetchItems(
emailController.text, passController.text);
}
},
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(
Icons.login,
color: context.colorScheme.surface,
),
context.emptySizedWidthBoxLow,
BodyText2Copy(
data: "Giriş",
color: context.colorScheme.surface,
fontWeight: FontWeight.bold,
),
],
),
style: ButtonStyle(
overlayColor: MaterialStateProperty.resolveWith<Color>(
(Set<MaterialState> states) {
if (states.contains(MaterialState.hovered)) {
return context.colorScheme.surface.withOpacity(0.2);
}
if (states.contains(MaterialState.focused) ||
states.contains(MaterialState.pressed)) {
return context.colorScheme.surface.withOpacity(0.2);
}
return Colors.red; // Defer to the widget's default.
},
),
backgroundColor:
MaterialStateProperty.all<Color>(Color(0xffe8f4f8)),
),
),
),
context.emptySizedHeightBoxLow3x,
SizedBox(
width: double.infinity,
height: context.dynamicHeight(0.065),
child: ElevatedButton(
onPressed: () {
Navigator.of(context).push(
MaterialPageRoute(builder: (context) => RegisterView()));
},
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(Icons.how_to_reg,
color: context.colorScheme.background),
context.emptySizedWidthBoxLow,
BodyText2Copy(
data: "Kayıt Ol",
color: context.colorScheme.background,
fontWeight: FontWeight.bold,
),
],
),
style: ButtonStyle(
overlayColor: MaterialStateProperty.resolveWith<Color>(
(Set<MaterialState> states) {
if (states.contains(MaterialState.hovered)) {
return context.colorScheme.background.withOpacity(0.2);
}
if (states.contains(MaterialState.focused) ||
states.contains(MaterialState.pressed)) {
return context.colorScheme.background.withOpacity(0.2);
}
return Colors.red; // Defer to the widget's default.
},
),
backgroundColor: MaterialStateProperty.all<Color>(
ColorSchemeLight.instance.pippin),
),
),
),
context.emptySizedHeightBoxLow,
],
),
),
);
}
_showDialog(
BuildContext context, double radius, String title, String content) {
showDialog(
context: context,
builder: (context) => AlertDialog(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(radius),
),
title: BodyText1Copy(
data: title,
color: context.colorScheme.onSecondary,
fontWeight: FontWeight.bold,
),
content: SizedBox(
height: context.dynamicHeight(0.14),
child: Column(
children: [
BodyText2Copy(data: content),
context.emptySizedHeightBoxLow,
Icon(
Icons.check_circle,
size: context.dynamicHeight(0.1),
color: context.colorScheme.onPrimary,
)
],
),
),
actions: [
Padding(
padding: context.horizontalPaddingLow,
child: ElevatedButton(
child: Text("Tamam",
style: TextStyle(color: context.colorScheme.onSurface)),
style: ElevatedButton.styleFrom(
primary: context.colorScheme.onError),
onPressed: () {
Navigator.of(context).pop();
},
),
),
],
));
}
}
| 0 |
mirrored_repositories/crm_app/lib/feature/auth/login | mirrored_repositories/crm_app/lib/feature/auth/login/model/login_model.dart | import 'package:json_annotation/json_annotation.dart';
part 'login_model.g.dart';
@JsonSerializable()
class LoginModel {
String? token;
String? status;
LoginModel({this.token, this.status});
factory LoginModel.fromJson(Map<String, dynamic> json) => _$LoginModelFromJson(json);
Map<String, dynamic> toJson() => _$LoginModelToJson(this);
} | 0 |
mirrored_repositories/crm_app/lib/feature/auth/login | mirrored_repositories/crm_app/lib/feature/auth/login/model/login_model.g.dart | // GENERATED CODE - DO NOT MODIFY BY HAND
part of 'login_model.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
LoginModel _$LoginModelFromJson(Map<String, dynamic> json) {
return LoginModel(
token: json['token'] as String?,
status: json['status'] as String?,
);
}
Map<String, dynamic> _$LoginModelToJson(LoginModel instance) =>
<String, dynamic>{
'token': instance.token,
'status': instance.status,
};
| 0 |
mirrored_repositories/crm_app/lib/feature/auth/login | mirrored_repositories/crm_app/lib/feature/auth/login/service/i_login_service.dart | import 'package:dio/dio.dart';
abstract class ILoginService {
final Dio dio;
ILoginService(this.dio);
Future<List<String>> fetchAllTask(String email,String password);
}
| 0 |
mirrored_repositories/crm_app/lib/feature/auth/login | mirrored_repositories/crm_app/lib/feature/auth/login/service/login_service_end_points.dart | enum LoginServiceEndPoints { endpoints }
extension LoginServiceExtension on LoginServiceEndPoints {
String rawValue(String email,String password) {
switch (this) {
case LoginServiceEndPoints.endpoints:
return 'Foreign/user_login?email=$email&password=$password';
}
}
} | 0 |
mirrored_repositories/crm_app/lib/feature/auth/login | mirrored_repositories/crm_app/lib/feature/auth/login/service/login_service.dart | import 'dart:convert';
import 'dart:io';
import '../../../../core/constants/app/app_constants.dart';
import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'i_login_service.dart';
import 'login_service_end_points.dart';
class LoginService extends ILoginService {
LoginService(Dio dio) : super(dio);
@override
Future<List<String>> fetchAllTask(String email, String password) async {
final response = await dio
.get(LoginServiceEndPoints.endpoints.rawValue(email, password));
if (response.statusCode == HttpStatus.ok) {
List<String> items = [];
final data = response.data;
var a = jsonDecode(data);
debugPrint("Token1: "+a['token']);
await dio.post("Projects/get_projects?token=${a['token']}");
ApplicationConstants.instance!.token = a['token'];
items.add(a['token']);
items.add(a['status']);
return items;
}
return [];
}
}
| 0 |
mirrored_repositories/crm_app/lib/feature/auth/login | mirrored_repositories/crm_app/lib/feature/auth/login/viewmodel/login_view_model.dart | import '../../../../core/init/network/network_manager.dart';
import '../service/i_login_service.dart';
import '../service/login_service.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:mobx/mobx.dart';
part 'login_view_model.g.dart';
class LoginViewModel = _LoginViewModelBase with _$LoginViewModel;
abstract class _LoginViewModelBase with Store {
BuildContext? context;
late ILoginService _loginService;
@observable
List<String>? item;
@observable
bool isRememberMe = false;
_LoginViewModelBase() {
_loginService = LoginService(NetworkManager.instance!.dio);
}
void setContext(BuildContext context) {
this.context = context;
}
@action
Future<void> fetchItems(String email, String password) async {
item = await _loginService.fetchAllTask(email, password);
}
@action
void changeRememberMe() {
isRememberMe = !isRememberMe;
}
}
| 0 |
mirrored_repositories/crm_app/lib/feature/auth/login | mirrored_repositories/crm_app/lib/feature/auth/login/viewmodel/login_view_model.g.dart | // GENERATED CODE - DO NOT MODIFY BY HAND
part of 'login_view_model.dart';
// **************************************************************************
// StoreGenerator
// **************************************************************************
// ignore_for_file: non_constant_identifier_names, unnecessary_brace_in_string_interps, unnecessary_lambdas, prefer_expression_function_bodies, lines_longer_than_80_chars, avoid_as, avoid_annotating_with_dynamic
mixin _$LoginViewModel on _LoginViewModelBase, Store {
final _$itemAtom = Atom(name: '_LoginViewModelBase.item');
@override
List<String>? get item {
_$itemAtom.reportRead();
return super.item;
}
@override
set item(List<String>? value) {
_$itemAtom.reportWrite(value, super.item, () {
super.item = value;
});
}
final _$isRememberMeAtom = Atom(name: '_LoginViewModelBase.isRememberMe');
@override
bool get isRememberMe {
_$isRememberMeAtom.reportRead();
return super.isRememberMe;
}
@override
set isRememberMe(bool value) {
_$isRememberMeAtom.reportWrite(value, super.isRememberMe, () {
super.isRememberMe = value;
});
}
final _$fetchItemsAsyncAction = AsyncAction('_LoginViewModelBase.fetchItems');
@override
Future<void> fetchItems(String email, String password) {
return _$fetchItemsAsyncAction.run(() => super.fetchItems(email, password));
}
final _$_LoginViewModelBaseActionController =
ActionController(name: '_LoginViewModelBase');
@override
void changeRememberMe() {
final _$actionInfo = _$_LoginViewModelBaseActionController.startAction(
name: '_LoginViewModelBase.changeRememberMe');
try {
return super.changeRememberMe();
} finally {
_$_LoginViewModelBaseActionController.endAction(_$actionInfo);
}
}
@override
String toString() {
return '''
item: ${item},
isRememberMe: ${isRememberMe}
''';
}
}
| 0 |
mirrored_repositories/crm_app/lib/feature/auth/register | mirrored_repositories/crm_app/lib/feature/auth/register/view/register_view.dart | // ignore_for_file: prefer_const_constructors, must_be_immutable
import 'package:cool_alert/cool_alert.dart';
import 'package:crm_app/core/components/text/subtitle1_copy.dart';
import 'package:crm_app/feature/auth/register/viewmodel/register_view_model.dart';
import 'package:flutter/material.dart';
import 'package:flutter_mobx/flutter_mobx.dart';
import 'package:kartal/kartal.dart';
class RegisterView extends StatelessWidget {
final RegisterViewModel _viewModel = RegisterViewModel();
final _formKey = GlobalKey<FormState>();
var emailController = TextEditingController();
var passController = TextEditingController();
String verificationCode = "";
RegisterView({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
body: Padding(
padding: context.paddingMedium,
child: Form(
key: _formKey,
autovalidateMode: AutovalidateMode.always,
child: Observer(
builder: (context) => Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Center(
child: Image.network(
"http://192.168.3.53/assets/images/logo-dark.png"),
),
context.emptySizedHeightBoxLow3x,
Subtitle1Copy(data: "Kuvarssoft CRM Sistemine hoş geldiniz !"),
context.emptySizedHeightBoxLow3x,
Padding(
padding: context.paddingLow,
child: const Text("Email"),
),
TextField(
controller: emailController,
keyboardType: TextInputType.emailAddress,
decoration: InputDecoration(
suffixIcon: SizedBox(
height: context.dynamicHeight(0.07),
child: ElevatedButton(
onPressed: () async {
CoolAlert.show(
context: context,
type: CoolAlertType.info,
title: "",
text:
'Kayıt isteğiniz başarılı !\n Lütfen mail adresinize gelen doğrulama kodunu giriniz.',
confirmBtnText: "Tamam",
loopAnimation: true,
confirmBtnColor: context.colorScheme.onPrimary,
);
// Dio dio = Dio();
// final response = await dio.get(
// "http://192.168.3.53/api/Foreign/lost_key?email=${emailController.text}");
// final mapVerificationCode =
// jsonDecode(response.data);
// verificationCode =
// mapVerificationCode['dogrulama'].toString();
// debugPrint(verificationCode);
_viewModel.openToClose();
},
child: Text(
"Doğrula",
style: TextStyle(color: context.colorScheme.onSurface),
),
style: ElevatedButton.styleFrom(
primary: context.colorScheme.secondaryVariant),
),
),
filled: true,
prefixIcon: const Icon(Icons.email),
hintText: 'Emaili giriniz.',
labelText: "Email",
enabledBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide: BorderSide(color: Colors.grey),
),
focusedBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide: BorderSide(color: context.colorScheme.surface),
),
),
cursorColor: context.colorScheme.onSecondary,
),
context.emptySizedHeightBoxLow3x,
AnimatedOpacity(
opacity: _viewModel.isOpen ? 1.0 : 0.0,
duration: context.durationLow,
child: TextFormField(
keyboardType: TextInputType.emailAddress,
decoration: InputDecoration(
suffixIcon: IconButton(
onPressed: () {
if (_formKey.currentState!.validate()) {
_viewModel.closeToOpen();
}
},
icon: const Icon(Icons.next_plan)),
filled: true,
prefixIcon: const Icon(Icons.check_circle),
hintText: 'Doğrulama kodunu giriniz.',
labelText: "Doğrulama kodu",
enabledBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide: BorderSide(
color: context.colorScheme.onBackground),
),
focusedBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide:
BorderSide(color: context.colorScheme.surface),
),
focusedErrorBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide: const BorderSide(color: Colors.red),
),
),
cursorColor: context.colorScheme.onSecondary,
validator: (value) {
if (verificationCode != value) {
return 'Geçersiz doğrulama kodu !';
}
},
),
),
],
)
),
),
),
);
}
}
| 0 |
mirrored_repositories/crm_app/lib/feature/auth/register | mirrored_repositories/crm_app/lib/feature/auth/register/viewmodel/register_view_model.dart | import 'package:mobx/mobx.dart';
part 'register_view_model.g.dart';
class RegisterViewModel = _RegisterViewModelBase with _$RegisterViewModel;
abstract class _RegisterViewModelBase with Store {
@observable
bool isOpen = false;
@observable
bool isClose = true;
@observable
bool isButtonClose = false;
@action
void openToClose() {
isOpen = !isOpen;
}
@action
void closeToOpen() {
isClose = !isClose;
}
@action
void buttonCloseOrOpen() {
isButtonClose = !isButtonClose;
}
}
| 0 |
mirrored_repositories/crm_app/lib/feature/auth/register | mirrored_repositories/crm_app/lib/feature/auth/register/viewmodel/register_view_model.g.dart | // GENERATED CODE - DO NOT MODIFY BY HAND
part of 'register_view_model.dart';
// **************************************************************************
// StoreGenerator
// **************************************************************************
// ignore_for_file: non_constant_identifier_names, unnecessary_brace_in_string_interps, unnecessary_lambdas, prefer_expression_function_bodies, lines_longer_than_80_chars, avoid_as, avoid_annotating_with_dynamic
mixin _$RegisterViewModel on _RegisterViewModelBase, Store {
final _$isOpenAtom = Atom(name: '_RegisterViewModelBase.isOpen');
@override
bool get isOpen {
_$isOpenAtom.reportRead();
return super.isOpen;
}
@override
set isOpen(bool value) {
_$isOpenAtom.reportWrite(value, super.isOpen, () {
super.isOpen = value;
});
}
final _$isCloseAtom = Atom(name: '_RegisterViewModelBase.isClose');
@override
bool get isClose {
_$isCloseAtom.reportRead();
return super.isClose;
}
@override
set isClose(bool value) {
_$isCloseAtom.reportWrite(value, super.isClose, () {
super.isClose = value;
});
}
final _$isButtonCloseAtom =
Atom(name: '_RegisterViewModelBase.isButtonClose');
@override
bool get isButtonClose {
_$isButtonCloseAtom.reportRead();
return super.isButtonClose;
}
@override
set isButtonClose(bool value) {
_$isButtonCloseAtom.reportWrite(value, super.isButtonClose, () {
super.isButtonClose = value;
});
}
final _$_RegisterViewModelBaseActionController =
ActionController(name: '_RegisterViewModelBase');
@override
void openToClose() {
final _$actionInfo = _$_RegisterViewModelBaseActionController.startAction(
name: '_RegisterViewModelBase.openToClose');
try {
return super.openToClose();
} finally {
_$_RegisterViewModelBaseActionController.endAction(_$actionInfo);
}
}
@override
void closeToOpen() {
final _$actionInfo = _$_RegisterViewModelBaseActionController.startAction(
name: '_RegisterViewModelBase.closeToOpen');
try {
return super.closeToOpen();
} finally {
_$_RegisterViewModelBaseActionController.endAction(_$actionInfo);
}
}
@override
void buttonCloseOrOpen() {
final _$actionInfo = _$_RegisterViewModelBaseActionController.startAction(
name: '_RegisterViewModelBase.buttonCloseOrOpen');
try {
return super.buttonCloseOrOpen();
} finally {
_$_RegisterViewModelBaseActionController.endAction(_$actionInfo);
}
}
@override
String toString() {
return '''
isOpen: ${isOpen},
isClose: ${isClose},
isButtonClose: ${isButtonClose}
''';
}
}
| 0 |
mirrored_repositories/crm_app/lib/feature/home/project | mirrored_repositories/crm_app/lib/feature/home/project/tab/project_tab.dart | // ignore_for_file: prefer_const_constructors
import 'package:flutter/material.dart';
import 'package:salomon_bottom_bar/salomon_bottom_bar.dart';
class ProjectTab extends StatefulWidget {
const ProjectTab({Key? key}) : super(key: key);
@override
_ProjectTabState createState() => _ProjectTabState();
}
class _ProjectTabState extends State<ProjectTab> {
int _currentIndex = 0;
List<Widget> tabs = [
Center(
child: Text("Detay"),
),
Center(
child: Text("Görevler"),
),
Center(
child: Text("Belgeler"),
),
Center(
child: Text("Erişim Sahipleri"),
),
];
@override
Widget build(BuildContext context) {
return Scaffold(
bottomNavigationBar: SalomonBottomBar(
currentIndex: _currentIndex,
items: [
SalomonBottomBarItem(
selectedColor: Color(0xff8950FC),
unselectedColor: Color(0xff8950FC),
icon: Icon(
Icons.home,
),
title: Text("Ana Sayfa"),
),
SalomonBottomBarItem(
selectedColor: Color(0xff663259),
unselectedColor: Color(0xff663259),
icon: Icon(
Icons.settings,
),
title: Text("Ayarlar"),
),
SalomonBottomBarItem(
selectedColor: Color(0xff1BC5BD),
unselectedColor: Color(0xff1BC5BD),
icon: Icon(Icons.access_time),
title: Text("Takvim"),
),
SalomonBottomBarItem(
selectedColor: Color(0xffF64E60),
unselectedColor: Color(0xffF64E60),
icon: Icon(
Icons.person,
),
title: Text("Çalışanlar")),
],
onTap: (index) => setState(() => _currentIndex = index),
),
body: tabs[_currentIndex],
);
}
}
| 0 |
mirrored_repositories/crm_app/lib/feature/home/contact | mirrored_repositories/crm_app/lib/feature/home/contact/view/contact_view.dart | // ignore_for_file: must_be_immutable, prefer_const_constructors
import 'package:crm_app/core/components/text/body_text1_copy.dart';
import 'package:crm_app/core/components/text/body_text2_copy.dart';
import 'package:crm_app/core/constants/app/app_constants.dart';
import 'package:crm_app/core/init/theme/light/color_scheme_light.dart';
import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:flutter_mobx/flutter_mobx.dart';
import 'package:flutter_slidable/flutter_slidable.dart';
import 'package:image_picker/image_picker.dart';
import 'package:kartal/kartal.dart';
import 'package:popup_card/popup_card.dart';
import '../contact_detail/view/contact_detail_guide_view.dart';
import '../contact_detail/view/contact_detail_users_view.dart';
import '../viewmodel/contact_view_model.dart';
class ContactView extends StatefulWidget {
const ContactView({Key? key}) : super(key: key);
@override
State<ContactView> createState() => _ContactViewState();
}
class _ContactViewState extends State<ContactView> {
final ContactViewModel _viewModel = ContactViewModel();
final imagePicker = ImagePicker();
String _image = "";
Future<void> pickImage() async {
final image = await imagePicker.pickImage(source: ImageSource.gallery);
setState(() {
_image = image!.path.substring(39);
});
debugPrint(_image);
}
@override
Widget build(BuildContext context) {
MediaQueryData mediaQuery = MediaQuery.of(context);
double height = mediaQuery.size.height;
double radius = height * 0.02;
_viewModel.fetchItems(ApplicationConstants.instance!.token);
return Scaffold(
appBar: AppBar(
title: Text(
"Kişi Yönetimi",
style: TextStyle(color: context.colorScheme.onSecondary),
),
backgroundColor: Colors.transparent,
automaticallyImplyLeading: false,
elevation: 0,
),
floatingActionButton: PopupItemLauncher(
tag: 'Proje Ekle',
child: Material(
color: context.colorScheme.primaryVariant,
elevation: 2,
shape: RoundedRectangleBorder(borderRadius: context.highBorderRadius),
child: Icon(
Icons.add_rounded,
size: 48,
color: context.colorScheme.onSurface,
),
),
popUp: PopUpItem(
padding: EdgeInsets.zero,
color: context.colorScheme.onSurface,
shape:
RoundedRectangleBorder(borderRadius: context.normalBorderRadius),
elevation: 2,
tag: 'Proje Ekle',
child: PopUpItemBody(
viewModel: _viewModel,
),
),
),
floatingActionButtonLocation: FloatingActionButtonLocation.miniEndDocked,
body: Observer(
builder: (context) => Padding(
padding: context.paddingLow,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: context.horizontalPaddingLow,
child: TextField(
decoration: InputDecoration(
labelText: 'Arama',
prefixIcon: Icon(Icons.search),
filled: true,
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(width: 2, color: Colors.grey),
borderRadius: BorderRadius.circular(15),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
width: 2, color: context.colorScheme.surface),
borderRadius: BorderRadius.circular(15),
),
),
),
),
context.emptySizedHeightBoxLow3x,
Expanded(
flex: 5,
child: Card(
elevation: 5,
shape: RoundedRectangleBorder(
borderRadius: context.lowBorderRadius),
child: Padding(
padding: context.paddingLow,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.fromLTRB(
context.normalValue,
context.lowValue,
context.normalValue,
context.lowValue),
child: const Text("Sisteme kayıtlı olan kişiler"),
),
context.emptySizedHeightBoxLow,
Expanded(
flex: 5,
child: ListView.builder(
itemCount: _viewModel.items.users?.length ?? 0,
physics: const BouncingScrollPhysics(),
itemBuilder: (context, index) => Padding(
padding: context.paddingLow,
child: Card(
color: context.colorScheme.secondary,
shape: RoundedRectangleBorder(
borderRadius: context.lowBorderRadius),
elevation: 5,
child: ListTile(
onTap: () {
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) =>
ContactUsersDetailView(
user: _viewModel.items.users?[index],
),
),
);
},
title: BodyText2Copy(
data: _viewModel
.items.users?[index].full_name ??
""),
subtitle: Text(
_viewModel.items.users?[index].email ?? "",
style: context.textTheme.button,
),
leading: CircleAvatar(
backgroundImage: NetworkImage(_viewModel
.items.users?[index].photo ??
"http://192.168.3.53/assets/images/users/user0.jpg"),
radius: 30,
),
trailing: const Icon(Icons.more_vert),
),
),
),
),
),
],
),
),
),
),
context.emptySizedHeightBoxLow3x,
Expanded(
flex: 4,
child: Card(
elevation: 5,
shape: RoundedRectangleBorder(
borderRadius: context.lowBorderRadius),
child: Padding(
padding: context.paddingLow,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.fromLTRB(
context.normalValue,
context.lowValue,
context.normalValue,
context.lowValue),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
// ignore: prefer_const_literals_to_create_immutables
children: [
Text("Sisteme kayıtlı olmayan kişiler"),
ElevatedButton(
onPressed: () {
debugPrint("statement");
},
child: Row(
// ignore: prefer_const_literals_to_create_immutables
children: [
Icon(
Icons.person_add,
color: ColorSchemeLight.instance.java,
),
context.emptySizedWidthBoxLow,
Text(
"Kişi Ekle",
style: TextStyle(
color: ColorSchemeLight.instance.java,
fontWeight: FontWeight.bold,
),
)
],
),
style: ElevatedButton.styleFrom(
primary:
ColorSchemeLight.instance.hummingBird,
shadowColor: ColorSchemeLight.instance.java,
),
)
],
),
),
context.emptySizedHeightBoxLow,
Expanded(
flex: 5,
child: ListView.builder(
itemCount: _viewModel.items.guides?.length ?? 0,
physics: const BouncingScrollPhysics(),
itemBuilder: (context, index) => Observer(
builder: (context) => Slidable(
actionPane: const SlidableDrawerActionPane(),
actions: [
IconSlideAction(
color: context.colorScheme.primaryVariant,
caption: 'Sil',
icon: Icons.delete,
onTap: () {
// CoolAlert.show(
// context: context,
// type: CoolAlertType.info,
// title: "",
// text:
// 'Kişi silmek istediğinizden emin misiniz ?\n Kişi kalıcı olarak',
// loopAnimation: false,
// cancelBtnText: "Hayır",
// showCancelBtn: true,
// confirmBtnColor:
// context.colorScheme.primaryVariant,
// );
_showDialog(
context, radius, _viewModel, index);
},
),
IconSlideAction(
color: context.colorScheme.onPrimary,
foregroundColor:
context.colorScheme.onSurface,
caption: 'Düzenle',
icon: Icons.edit,
onTap: () {
_showModalBottomSheet(
context, radius, index);
debugPrint(_viewModel.items.message);
},
),
],
secondaryActions: [
IconSlideAction(
color: context.colorScheme.onError,
foregroundColor:
context.colorScheme.onSurface,
caption: 'Ara',
icon: Icons.call,
onTap: () {
_showModalBottomSheet(
context, radius, index);
debugPrint(_viewModel.items.message);
},
),
IconSlideAction(
color: context.colorScheme.background,
foregroundColor:
context.colorScheme.onSurface,
caption: 'Mesaj',
icon: Icons.message,
onTap: () {
_showModalBottomSheet(
context, radius, index);
debugPrint(_viewModel.items.message);
},
),
],
child: Padding(
padding: context.paddingLow,
child: Card(
color: context.colorScheme.secondary,
shape: RoundedRectangleBorder(
borderRadius: context.lowBorderRadius),
elevation: 5,
child: ListTile(
onTap: () {
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) =>
ContactGuidesDetailView(
guides: _viewModel
.items.guides?[index],
),
),
);
},
title: BodyText2Copy(
data: _viewModel
.items.guides?[index].name ??
""),
subtitle: Text(
_viewModel.items.guides?[index].email ??
"",
style: context.textTheme.button,
),
leading: CircleAvatar(
backgroundImage: NetworkImage(_viewModel
.items.guides?[index].photo ??
"http://192.168.3.53/assets/images/users/user0.jpg"),
radius: 30,
),
trailing: const Icon(
Icons.keyboard_arrow_right),
),
),
),
),
),
),
),
],
),
),
),
),
context.emptySizedHeightBoxLow3x,
Padding(
padding: context.horizontalPaddingNormal,
child: const Text(
"Kişiyi silmek veya düzenlemek için sağa kaydırınız."),
)
],
),
),
),
);
}
_showModalBottomSheet(context, double radius, int index) {
var nameController = TextEditingController();
var eMailController = TextEditingController();
var phoneController = TextEditingController();
var detailController = TextEditingController();
var jobController = TextEditingController();
var birthDayController = TextEditingController();
var webSiteController = TextEditingController();
var locationController = TextEditingController();
showModalBottomSheet(
isScrollControlled: true,
context: context,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(radius),
),
builder: (BuildContext context) {
return SingleChildScrollView(
child: Container(
height: context.dynamicHeight(1.3),
padding: context.paddingNormal,
decoration: BoxDecoration(
color: context.colorScheme.onSurface,
borderRadius: BorderRadius.only(
topLeft: context.highadius,
topRight: context.highadius,
),
),
child: Column(
children: [
context.emptySizedHeightBoxLow3x,
Padding(
padding: context.paddingLow,
child: const Text("Kişi"),
),
TextField(
controller: nameController,
decoration: InputDecoration(
prefixIcon: const Icon(Icons.person),
hintText: 'Kişinin ismi',
labelText: "İsim",
enabledBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide:
BorderSide(color: context.colorScheme.onBackground),
),
focusedBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide:
BorderSide(color: context.colorScheme.surface),
),
),
cursorColor: context.colorScheme.onSecondary,
),
context.emptySizedHeightBoxLow,
Padding(
padding: context.paddingLow,
child: const Text("Email"),
),
TextField(
keyboardType: TextInputType.emailAddress,
controller: eMailController,
decoration: InputDecoration(
hintText: 'Kişinin emaili',
prefixIcon: const Icon(Icons.email),
labelText: "Email",
enabledBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide:
BorderSide(color: context.colorScheme.onBackground),
),
focusedBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide:
BorderSide(color: context.colorScheme.surface),
),
),
cursorColor: context.colorScheme.onSecondary,
),
Padding(
padding: context.paddingLow,
child: const Text("Telefon"),
),
TextField(
keyboardType: TextInputType.phone,
controller: phoneController,
decoration: InputDecoration(
prefixIcon: const Icon(Icons.phone),
hintText: 'Kişinin telefonu',
labelText: "Telefon",
enabledBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide:
BorderSide(color: context.colorScheme.onBackground),
),
focusedBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide:
BorderSide(color: context.colorScheme.surface),
),
),
cursorColor: context.colorScheme.onSecondary,
),
context.emptySizedHeightBoxLow,
Padding(
padding: context.paddingLow,
child: const Text("Hakkında"),
),
TextField(
controller: detailController,
decoration: InputDecoration(
prefixIcon: const Icon(Icons.description),
hintText: 'Kişinin detayı',
labelText: "Hakkında",
enabledBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide:
BorderSide(color: context.colorScheme.onBackground),
),
focusedBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide:
BorderSide(color: context.colorScheme.surface),
),
),
cursorColor: context.colorScheme.onSecondary,
),
context.emptySizedHeightBoxLow,
Padding(
padding: context.paddingLow,
child: const Text("Meslek"),
),
TextField(
controller: jobController,
decoration: InputDecoration(
prefixIcon: const Icon(Icons.work),
hintText: 'Kişinin mesleği',
labelText: "Meslek",
enabledBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide:
BorderSide(color: context.colorScheme.onBackground),
),
focusedBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide:
BorderSide(color: context.colorScheme.surface),
),
),
cursorColor: context.colorScheme.onSecondary,
),
context.emptySizedHeightBoxLow,
Padding(
padding: context.paddingLow,
child: const Text("Doğum günü"),
),
TextField(
keyboardType: TextInputType.datetime,
controller: birthDayController,
decoration: InputDecoration(
prefixIcon: const Icon(Icons.cake),
hintText: 'Kişinin doğum günü',
labelText: "Doğum Günü",
enabledBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide:
BorderSide(color: context.colorScheme.onBackground),
),
focusedBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide:
BorderSide(color: context.colorScheme.surface),
),
),
cursorColor: context.colorScheme.onSecondary,
),
context.emptySizedHeightBoxLow,
Padding(
padding: context.paddingLow,
child: const Text("Web Sitesi"),
),
TextField(
controller: webSiteController,
decoration: InputDecoration(
prefixIcon: const Icon(Icons.public),
hintText: 'Kişinin web sitesi',
labelText: "Web Sitesi",
enabledBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide:
BorderSide(color: context.colorScheme.onBackground),
),
focusedBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide:
BorderSide(color: context.colorScheme.surface),
),
),
cursorColor: context.colorScheme.onSecondary,
),
context.emptySizedHeightBoxLow,
Padding(
padding: context.paddingLow,
child: const Text("Konum"),
),
TextField(
controller: locationController,
decoration: InputDecoration(
prefixIcon: const Icon(Icons.location_on),
hintText: 'Kişinin konumu',
labelText: "Konum",
enabledBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide:
BorderSide(color: context.colorScheme.onBackground),
),
focusedBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide:
BorderSide(color: context.colorScheme.surface),
),
),
cursorColor: context.colorScheme.onSecondary,
),
context.emptySizedHeightBoxLow3x,
Expanded(
child: SizedBox(
width: double.infinity,
child: ElevatedButton(
onPressed: () {
pickImage();
},
child: Text(
"Resim Yükle",
style: TextStyle(color: context.colorScheme.onSurface),
),
),
),
),
context.emptySizedHeightBoxLow3x,
Divider(
color: context.colorScheme.secondaryVariant,
thickness: 0.4,
),
Padding(
padding: context.paddingLow,
child: Row(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.end,
children: [
ElevatedButton(
onPressed: () {
Navigator.of(context).pop();
},
child: BodyText2Copy(
data: "Vazgeç",
color: context.colorScheme.onSurface),
style: ElevatedButton.styleFrom(
primary: context.colorScheme.secondaryVariant),
),
context.emptySizedWidthBoxLow,
ElevatedButton(
onPressed: () async {
// String baseImageUrl =
// "http://192.168.3.53/assets/images/users/";
Dio dio = Dio();
await dio.post(
"http://192.168.3.53/api/Persons/update_guide?token=${ApplicationConstants.instance!.token}&id=${_viewModel.items.guides?[index].id}&name=${nameController.text}&email=${eMailController.text}&tel=${phoneController.text}&detail=${detailController.text}&company_id=${_viewModel.items.guides?[index].companyId}&job=${jobController.text}&photo=$_image&birthday=${birthDayController.text}&web_site=${webSiteController.text}&location=${locationController.text}");
setState(() {
_viewModel.fetchItems(
ApplicationConstants.instance!.token);
Navigator.of(context).pop();
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
backgroundColor:
context.colorScheme.secondaryVariant,
duration: context.durationSlow,
content: BodyText2Copy(
data: "Kişi başarıyla güncellendi !",
color: context.colorScheme.onSurface,
),
),
);
});
},
child: BodyText2Copy(
data: "Kaydet",
color: context.colorScheme.onSurface),
style: ElevatedButton.styleFrom(
primary: context.colorScheme.surface),
),
],
),
),
],
),
),
);
},
);
}
_showDialog(BuildContext context, double radius, ContactViewModel viewModel,
int index) {
showDialog(
context: context,
builder: (context) => AlertDialog(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(radius),
),
title: const BodyText1Copy(
data: "Kişiyi silmek istediğinizden emin misiniz ?"),
content:
const BodyText2Copy(data: "Kişi kalıcı olarak silinecektir."),
actions: [
ElevatedButton(
child: Text("Evet",
style: TextStyle(color: context.colorScheme.onSurface)),
style: ElevatedButton.styleFrom(
primary: context.colorScheme.surface),
onPressed: () {
final Dio dio = Dio();
dio.post(
"http://192.168.3.53/api/Persons/delete_guide?token=${ApplicationConstants.instance!.token}&id=${viewModel.items.guides?[index].id}");
viewModel.fetchItems(ApplicationConstants.instance!.token);
Navigator.of(context).pop();
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
backgroundColor: context.colorScheme.secondaryVariant,
duration: context.durationSlow,
content: BodyText2Copy(
data: "Kişi başarıyla silindi !",
color: context.colorScheme.onSurface,
),
),
);
},
),
ElevatedButton(
onPressed: () {
Navigator.of(context).pop();
},
style: ElevatedButton.styleFrom(
primary: context.colorScheme.secondaryVariant),
child: Text(
"Hayır",
style: TextStyle(color: context.colorScheme.onSurface),
),
)
],
));
}
}
class PopUpItemBody extends StatefulWidget {
final ContactViewModel viewModel;
const PopUpItemBody({
Key? key,
required this.viewModel,
}) : super(key: key);
@override
State<PopUpItemBody> createState() => _PopUpItemBodyState();
}
class _PopUpItemBodyState extends State<PopUpItemBody> {
var nameController = TextEditingController();
var eMailController = TextEditingController();
var phoneController = TextEditingController();
var detailController = TextEditingController();
var jobController = TextEditingController();
late final ContactViewModel viewModel;
@override
void initState() {
super.initState();
viewModel = widget.viewModel;
}
@override
Widget build(BuildContext context) {
return SizedBox(
height: context.dynamicHeight(1.1),
child: Center(
child: Padding(
padding: context.paddingNormal,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Align(
alignment: Alignment.topRight,
child: GestureDetector(
onTap: () {
Navigator.pop(context);
},
child: CircleAvatar(
backgroundColor: context.colorScheme.primaryVariant,
child: Icon(
Icons.close,
color: context.colorScheme.onSurface,
),
),
),
),
Center(
child: Padding(
padding: context.paddingLow,
child: const BodyText1Copy(data: "Kişi Ekle")),
),
Padding(
padding: context.paddingLow,
child: const Text("İsim"),
),
context.emptySizedHeightBoxLow,
TextField(
controller: nameController,
decoration: InputDecoration(
prefixIcon: const Icon(Icons.person),
labelText: "İsim",
hintText: 'Kişinin ismini giriniz.',
enabledBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide:
BorderSide(color: context.colorScheme.onBackground),
),
focusedBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide: BorderSide(color: context.colorScheme.surface),
),
),
cursorColor: context.colorScheme.onSecondary,
),
context.emptySizedHeightBoxLow,
Padding(
padding: context.paddingLow,
child: const Text("Eposta"),
),
context.emptySizedHeightBoxLow,
TextField(
keyboardType: TextInputType.emailAddress,
controller: eMailController,
decoration: InputDecoration(
prefixIcon: const Icon(Icons.email),
labelText: "Eposta",
hintText: 'Eposta giriniz.',
enabledBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide:
BorderSide(color: context.colorScheme.onBackground),
),
focusedBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide: BorderSide(color: context.colorScheme.surface),
),
),
cursorColor: context.colorScheme.onSecondary,
),
context.emptySizedHeightBoxLow,
Padding(
padding: context.paddingLow,
child: const Text("Telefon"),
),
context.emptySizedHeightBoxLow,
TextField(
keyboardType: TextInputType.phone,
controller: phoneController,
decoration: InputDecoration(
prefixIcon: const Icon(Icons.phone),
labelText: 'Telefon',
hintText: 'Telefon giriniz.',
enabledBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide:
BorderSide(color: context.colorScheme.onBackground),
),
focusedBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide: BorderSide(color: context.colorScheme.surface),
),
),
cursorColor: context.colorScheme.onSecondary,
),
context.emptySizedHeightBoxLow,
Padding(
padding: context.paddingLow,
child: const Text("Hakkında"),
),
context.emptySizedHeightBoxLow,
TextField(
controller: detailController,
decoration: InputDecoration(
prefixIcon: const Icon(Icons.description),
labelText: 'Hakkında',
hintText: 'Hakkında giriniz.',
enabledBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide:
BorderSide(color: context.colorScheme.onBackground),
),
focusedBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide: BorderSide(color: context.colorScheme.surface),
),
),
cursorColor: context.colorScheme.onSecondary,
maxLines: 2,
),
context.emptySizedHeightBoxLow,
Padding(
padding: context.paddingLow,
child: const Text("Meslek"),
),
context.emptySizedHeightBoxLow,
TextField(
controller: jobController,
decoration: InputDecoration(
prefixIcon: const Icon(Icons.work),
labelText: 'Meslek',
hintText: 'Meslek giriniz.',
enabledBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide:
BorderSide(color: context.colorScheme.onBackground),
),
focusedBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide: BorderSide(color: context.colorScheme.surface),
),
),
cursorColor: context.colorScheme.onSecondary,
),
context.emptySizedHeightBoxLow,
context.emptySizedHeightBoxLow,
Divider(
color: context.colorScheme.secondaryVariant,
thickness: 0.4,
),
Padding(
padding: context.paddingLow,
child: Row(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.end,
children: [
ElevatedButton(
onPressed: () {
Navigator.of(context).pop();
},
child: BodyText2Copy(
data: "Vazgeç", color: context.colorScheme.onSurface),
style: ElevatedButton.styleFrom(
primary: context.colorScheme.secondaryVariant),
),
context.emptySizedWidthBoxLow,
ElevatedButton(
onPressed: () async {
Dio dio = Dio();
await dio.post(
"http://192.168.3.53/api/Persons/new_guide?token=${ApplicationConstants.instance!.token}&name=${nameController.text}&email=${eMailController.text}&tel=${eMailController.text}&detail=${detailController.text}&company_id=${eMailController.text}&job=${jobController.text}");
Navigator.of(context).pop();
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
backgroundColor:
context.colorScheme.secondaryVariant,
duration: context.durationSlow,
content: BodyText2Copy(
data: "Kişi başarıyla eklendi !",
color: context.colorScheme.onSurface,
),
),
);
setState(() {
viewModel
.fetchItems(ApplicationConstants.instance!.token);
});
},
child: BodyText2Copy(
data: "Ekle", color: context.colorScheme.onSurface),
style: ElevatedButton.styleFrom(
primary: context.colorScheme.surface),
),
],
),
),
],
),
),
),
);
}
}
| 0 |
mirrored_repositories/crm_app/lib/feature/home/contact | mirrored_repositories/crm_app/lib/feature/home/contact/model/contact_model.g.dart | // GENERATED CODE - DO NOT MODIFY BY HAND
part of 'contact_model.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
ContactModel _$ContactModelFromJson(Map<String, dynamic> json) {
return ContactModel(
message: json['message'] as String?,
userid: json['userid'] as String?,
users: (json['users'] as List<dynamic>?)
?.map((e) => Users.fromJson(e as Map<String, dynamic>))
.toList(),
guides: (json['guides'] as List<dynamic>?)
?.map((e) => Guides.fromJson(e as Map<String, dynamic>))
.toList(),
);
}
Map<String, dynamic> _$ContactModelToJson(ContactModel instance) =>
<String, dynamic>{
'message': instance.message,
'userid': instance.userid,
'users': instance.users,
'guides': instance.guides,
};
Users _$UsersFromJson(Map<String, dynamic> json) {
return Users(
screenName: json['screenName'] as String?,
id: json['id'] as String?,
full_name: json['full_name'] as String?,
company: json['company'] as String?,
email: json['email'] as String?,
photo: json['photo'] as String?,
telephone: json['telephone'] as String?,
detail: json['detail'] as String?,
job: json['job'] as String?,
birthday: json['birthday'] as String?,
);
}
Map<String, dynamic> _$UsersToJson(Users instance) => <String, dynamic>{
'screenName': instance.screenName,
'id': instance.id,
'full_name': instance.full_name,
'company': instance.company,
'email': instance.email,
'photo': instance.photo,
'telephone': instance.telephone,
'detail': instance.detail,
'job': instance.job,
'birthday': instance.birthday,
};
Guides _$GuidesFromJson(Map<String, dynamic> json) {
return Guides(
id: json['id'] as String?,
name: json['name'] as String?,
email: json['email'] as String?,
phone: json['phone'] as String?,
isActive: json['isActive'] as String?,
detail: json['detail'] as String?,
company: json['company'] as String?,
companyId: json['companyId'] as String?,
job: json['job'] as String?,
birthday: json['birthday'] as String?,
added: json['added'] as String?,
updated: json['updated'] as String?,
webSite: json['webSite'] as String?,
location: json['location'] as String?,
photo: json['photo'] as String?,
userId: json['userId'] as String?,
customer: json['customer'] as String?,
worker: json['worker'] as String?,
);
}
Map<String, dynamic> _$GuidesToJson(Guides instance) => <String, dynamic>{
'id': instance.id,
'name': instance.name,
'email': instance.email,
'phone': instance.phone,
'isActive': instance.isActive,
'detail': instance.detail,
'company': instance.company,
'companyId': instance.companyId,
'job': instance.job,
'birthday': instance.birthday,
'added': instance.added,
'updated': instance.updated,
'webSite': instance.webSite,
'location': instance.location,
'photo': instance.photo,
'userId': instance.userId,
'customer': instance.customer,
'worker': instance.worker,
};
| 0 |
mirrored_repositories/crm_app/lib/feature/home/contact | mirrored_repositories/crm_app/lib/feature/home/contact/model/contact_model.dart | // ignore_for_file: non_constant_identifier_names, duplicate_ignore
import 'package:json_annotation/json_annotation.dart';
part 'contact_model.g.dart';
@JsonSerializable()
class ContactModel {
String? message;
String? userid;
List<Users>? users;
List<Guides>? guides;
ContactModel({this.message, this.userid, this.users, this.guides});
factory ContactModel.fromJson(Map<String, dynamic> json) =>
_$ContactModelFromJson(json);
Map<String, dynamic> toJson() => _$ContactModelToJson(this);
}
@JsonSerializable()
class Users {
String? screenName;
// ignore: non_constant_identifier_names
String? id;
String? full_name;
String? company;
String? email;
String? photo;
String? telephone;
String? detail;
String? job;
String? birthday;
@JsonKey(ignore: true)
bool isSelect = false;
Users(
{this.screenName,
this.id,
this.full_name,
this.company,
this.email,
this.photo,
this.telephone,
this.detail,
this.job,
this.birthday});
factory Users.fromJson(Map<String, dynamic> json) => _$UsersFromJson(json);
Map<String, dynamic> toJson() => _$UsersToJson(this);
}
@JsonSerializable()
class Guides {
String? id;
String? name;
String? email;
String? phone;
String? isActive;
String? detail;
String? company;
String? companyId;
String? job;
String? birthday;
String? added;
String? updated;
String? webSite;
String? location;
String? photo;
String? userId;
String? customer;
String? worker;
@JsonKey(ignore: true)
bool isSelect = false;
Guides(
{this.id,
this.name,
this.email,
this.phone,
this.isActive,
this.detail,
this.company,
this.companyId,
this.job,
this.birthday,
this.added,
this.updated,
this.webSite,
this.location,
this.photo,
this.userId,
this.customer,
this.worker});
factory Guides.fromJson(Map<String, dynamic> json) => _$GuidesFromJson(json);
Map<String, dynamic> toJson() => _$GuidesToJson(this);
}
| 0 |
mirrored_repositories/crm_app/lib/feature/home/contact | mirrored_repositories/crm_app/lib/feature/home/contact/service/contact_service.dart | import 'dart:io';
import 'package:dio/dio.dart';
import '../model/contact_model.dart';
import 'contact_service_end_points.dart';
import 'i_contact_service.dart';
class ContactService extends IContactService {
ContactService(Dio dio) : super(dio);
@override
Future<ContactModel> fetchAllTask(String token) async {
final response =
await dio.get(ContactServiceEndPoints.contact.rawValue(token));
if (response.statusCode == HttpStatus.ok) {
return ContactModel.fromJson(response.data);
}
return ContactModel();
}
}
| 0 |
mirrored_repositories/crm_app/lib/feature/home/contact | mirrored_repositories/crm_app/lib/feature/home/contact/service/i_contact_service.dart | import 'package:dio/dio.dart';
import '../model/contact_model.dart';
abstract class IContactService {
final Dio dio;
IContactService(this.dio);
Future<ContactModel> fetchAllTask(String token);
}
| 0 |
mirrored_repositories/crm_app/lib/feature/home/contact | mirrored_repositories/crm_app/lib/feature/home/contact/service/contact_service_end_points.dart | enum ContactServiceEndPoints { contact }
extension ContactServiceExtension on ContactServiceEndPoints {
String rawValue(String token) {
switch (this) {
case ContactServiceEndPoints.contact:
return 'Persons/get_persons?token=$token';
}
}
} | 0 |
mirrored_repositories/crm_app/lib/feature/home/contact/contact_detail | mirrored_repositories/crm_app/lib/feature/home/contact/contact_detail/view/contact_detail_users_view.dart | // ignore_for_file: prefer_const_constructors
import 'package:crm_app/core/init/theme/light/color_scheme_light.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:kartal/kartal.dart';
import '../../../../../core/components/text/body_text1_copy.dart';
import '../../../../../core/components/text/body_text2_copy.dart';
import '../../model/contact_model.dart';
class ContactUsersDetailView extends StatelessWidget {
final Users? user;
const ContactUsersDetailView({Key? key, this.user}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Image.network(
"http://192.168.3.53/assets/images/logo-light.png",
width: context.dynamicWidth(0.28),
),
centerTitle: true,
),
body: Padding(
padding: context.paddingNormal,
child: SizedBox(
height: context.dynamicHeight(0.67),
child: Card(
shape: RoundedRectangleBorder(
borderRadius: context.normalBorderRadius),
elevation: 5,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Padding(
padding: context.paddingNormal,
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
CircleAvatar(
backgroundImage: NetworkImage(user?.photo ??
"http://192.168.3.53/assets/images/users/user0.jpg"),
radius: 50,
),
context.emptySizedWidthBoxLow,
Expanded(
child: ListTile(
title: BodyText1Copy(data: user?.full_name ?? ""),
subtitle: Column(
children: [
Row(
children: [
Icon(Icons.business,
color: ColorSchemeLight
.instance.piegonPost),
context.emptySizedWidthBoxLow,
Text(
user?.company ?? "",
style: context.textTheme.caption!
.copyWith(
color: ColorSchemeLight
.instance.piegonPost,
fontWeight: FontWeight.bold),
),
],
),
context.emptySizedHeightBoxLow,
Row(
children: [
ElevatedButton(
onPressed: () {},
child: Text(
"Görüntüleyebilir",
style: TextStyle(
color:
ColorSchemeLight.instance.java),
),
style: ElevatedButton.styleFrom(
primary: ColorSchemeLight
.instance.hummingBird,
shape: RoundedRectangleBorder(
borderRadius: context.lowBorderRadius,
),
),
),
context.emptySizedWidthBoxLow,
ElevatedButton(
onPressed: () {},
child: Icon(
Icons.more_horiz,
color: context.colorScheme.background,
),
style: ElevatedButton.styleFrom(
primary:
ColorSchemeLight.instance.amour,
shape: RoundedRectangleBorder(
borderRadius: context.lowBorderRadius,
),
),
)
],
),
],
),
),
),
],
),
),
),
context.emptySizedHeightBoxLow,
Expanded(
flex: 3,
child: Padding(
padding: context.paddingNormal,
child: Column(
// ignore: prefer_const_literals_to_create_immutables
children: [
Center(
child: Container(
width: double.infinity,
height: context.dynamicHeight(0.05),
padding: context.paddingLow,
decoration: BoxDecoration(
color: context.colorScheme.secondary,
borderRadius: context.lowBorderRadius),
child: Wrap(
crossAxisAlignment: WrapCrossAlignment.center,
spacing: 5,
// ignore: prefer_const_literals_to_create_immutables
children: [
Icon(
Icons.account_circle,
),
BodyText2Copy(
data: "KİŞİSEL BİLGİLER",
fontWeight: FontWeight.bold,
)
],
),
),
),
context.emptySizedHeightBoxLow3x,
Row(
children: [
BodyText2Copy(
data: "HAKKIMDA : ",
fontWeight: FontWeight.bold,
),
Text(user?.detail ?? ""),
],
),
context.emptySizedHeightBoxLow3x,
Row(
children: [
BodyText2Copy(
data: "DOĞUM TARİHİ : ",
fontWeight: FontWeight.bold,
),
Text(user?.birthday ?? ""),
],
),
context.emptySizedHeightBoxLow3x,
Row(
children: [
BodyText2Copy(
data: "FİRMA : ",
fontWeight: FontWeight.bold,
),
Text(user?.company ?? ""),
],
),
context.emptySizedHeightBoxLow3x,
Row(
children: [
BodyText2Copy(
data: "MESLEK : ",
fontWeight: FontWeight.bold,
),
Text(user?.job ?? ""),
],
),
context.emptySizedHeightBoxLow3x,
Row(
children: [
BodyText2Copy(
data: "EPOSTA : ",
fontWeight: FontWeight.bold,
),
Text(user?.email ?? ""),
],
),
context.emptySizedHeightBoxLow3x,
Row(
children: [
BodyText2Copy(
data: "TELEFON : ",
fontWeight: FontWeight.bold,
),
Text(user?.telephone ?? ""),
],
),
context.emptySizedHeightBoxLow,
Center(
child: ElevatedButton(
onPressed: () {},
child: Text(
"MESAJ GÖNDER",
style: TextStyle(
color: ColorSchemeLight.instance.java,
fontWeight: FontWeight.bold),
),
style: ElevatedButton.styleFrom(
primary: ColorSchemeLight.instance.hummingBird,
shape: RoundedRectangleBorder(
borderRadius: context.lowBorderRadius,
),
),
),
),
],
),
),
),
],
),
),
),
),
);
}
}
| 0 |
mirrored_repositories/crm_app/lib/feature/home/contact/contact_detail | mirrored_repositories/crm_app/lib/feature/home/contact/contact_detail/view/contact_detail_guide_view.dart | // ignore_for_file: prefer_const_constructors
import 'package:crm_app/core/init/theme/light/color_scheme_light.dart';
import '../../../../../core/components/text/body_text1_copy.dart';
import '../../../../../core/components/text/body_text2_copy.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:kartal/kartal.dart';
import '../../model/contact_model.dart';
class ContactGuidesDetailView extends StatelessWidget {
final Guides? guides;
const ContactGuidesDetailView({Key? key, this.guides}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Image.network(
"http://192.168.3.53/assets/images/logo-light.png",
width: context.dynamicWidth(0.28),
),
centerTitle: true,
),
body: Padding(
padding: context.paddingNormal,
child: SizedBox(
height: context.dynamicHeight(0.67),
child: Card(
shape: RoundedRectangleBorder(
borderRadius: context.normalBorderRadius),
elevation: 5,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Padding(
padding: context.paddingNormal,
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
CircleAvatar(
backgroundImage: NetworkImage(guides?.photo ??
"http://192.168.3.53/assets/images/users/user0.jpg"),
radius: 50,
),
context.emptySizedWidthBoxLow,
Expanded(
child: ListTile(
title: BodyText1Copy(data: guides?.name ?? ""),
subtitle: Column(
children: [
Row(
children: [
Icon(Icons.business,
color: ColorSchemeLight
.instance.piegonPost),
context.emptySizedWidthBoxLow,
Text(
guides?.company ?? "",
style: context.textTheme.caption!
.copyWith(
color: ColorSchemeLight
.instance.piegonPost,
fontWeight: FontWeight.bold),
),
],
),
context.emptySizedHeightBoxLow,
Row(
children: [
ElevatedButton(
onPressed: () {},
child: Text(
"Görüntüleyebilir",
style: TextStyle(
color:
ColorSchemeLight.instance.java),
),
style: ElevatedButton.styleFrom(
primary: ColorSchemeLight
.instance.hummingBird,
shape: RoundedRectangleBorder(
borderRadius: context.lowBorderRadius,
),
),
),
context.emptySizedWidthBoxLow,
ElevatedButton(
onPressed: () {},
child: Icon(
Icons.more_horiz,
color: context.colorScheme.background,
),
style: ElevatedButton.styleFrom(
primary:
ColorSchemeLight.instance.amour,
shape: RoundedRectangleBorder(
borderRadius: context.lowBorderRadius,
),
),
)
],
),
],
),
),
),
],
),
),
),
context.emptySizedHeightBoxLow,
Expanded(
flex: 3,
child: Padding(
padding: context.paddingNormal,
child: Column(
// ignore: prefer_const_literals_to_create_immutables
children: [
Center(
child: Container(
width: double.infinity,
height: context.dynamicHeight(0.05),
padding: context.paddingLow,
decoration: BoxDecoration(
color: context.colorScheme.secondary,
borderRadius: context.lowBorderRadius),
child: Wrap(
crossAxisAlignment: WrapCrossAlignment.center,
spacing: 5,
// ignore: prefer_const_literals_to_create_immutables
children: [
Icon(
Icons.account_circle,
),
BodyText2Copy(
data: "KİŞİSEL BİLGİLER",
fontWeight: FontWeight.bold,
)
],
),
),
),
context.emptySizedHeightBoxLow3x,
Row(
children: [
BodyText2Copy(
data: "HAKKIMDA : ",
fontWeight: FontWeight.bold,
),
Text(guides?.detail ?? ""),
],
),
context.emptySizedHeightBoxLow3x,
Row(
children: [
BodyText2Copy(
data: "DOĞUM TARİHİ : ",
fontWeight: FontWeight.bold,
),
Text(guides?.birthday ?? ""),
],
),
context.emptySizedHeightBoxLow3x,
Row(
children: [
BodyText2Copy(
data: "FİRMA : ",
fontWeight: FontWeight.bold,
),
Text(guides?.company ?? ""),
],
),
context.emptySizedHeightBoxLow3x,
Row(
children: [
BodyText2Copy(
data: "MESLEK : ",
fontWeight: FontWeight.bold,
),
Text(guides?.job ?? ""),
],
),
context.emptySizedHeightBoxLow3x,
Row(
children: [
BodyText2Copy(
data: "EPOSTA : ",
fontWeight: FontWeight.bold,
),
Text(guides?.email ?? ""),
],
),
context.emptySizedHeightBoxLow3x,
Row(
children: [
BodyText2Copy(
data: "TELEFON : ",
fontWeight: FontWeight.bold,
),
Text(guides?.phone ?? ""),
],
),
context.emptySizedHeightBoxLow,
Center(
child: ElevatedButton(
onPressed: () {},
child: Text(
"MESAJ GÖNDER",
style: TextStyle(
color: ColorSchemeLight.instance.java,
fontWeight: FontWeight.bold),
),
style: ElevatedButton.styleFrom(
primary: ColorSchemeLight.instance.hummingBird,
shape: RoundedRectangleBorder(
borderRadius: context.lowBorderRadius,
),
),
),
),
],
),
),
),
],
),
),
),
),
);
}
}
| 0 |
mirrored_repositories/crm_app/lib/feature/home/contact | mirrored_repositories/crm_app/lib/feature/home/contact/viewmodel/contact_view_model.dart | import 'package:flutter/material.dart';
import 'package:mobx/mobx.dart';
import '../../../../core/init/network/network_manager.dart';
import '../model/contact_model.dart';
import '../service/contact_service.dart';
import '../service/i_contact_service.dart';
part 'contact_view_model.g.dart';
class ContactViewModel = _ContactViewModelBase with _$ContactViewModel;
abstract class _ContactViewModelBase with Store {
BuildContext? context;
late IContactService contactService;
@observable
ContactModel items = ContactModel();
@observable
int lenght = 0;
_ContactViewModelBase() {
contactService = ContactService(NetworkManager.instance!.dio);
}
void setContext(BuildContext context) {
this.context = context;
}
@action
Future<void> fetchItems(String token) async {
items = await contactService.fetchAllTask(token);
lenght = items.guides!.length + items.users!.length;
}
}
| 0 |
mirrored_repositories/crm_app/lib/feature/home/contact | mirrored_repositories/crm_app/lib/feature/home/contact/viewmodel/contact_view_model.g.dart | // GENERATED CODE - DO NOT MODIFY BY HAND
part of 'contact_view_model.dart';
// **************************************************************************
// StoreGenerator
// **************************************************************************
// ignore_for_file: non_constant_identifier_names, unnecessary_brace_in_string_interps, unnecessary_lambdas, prefer_expression_function_bodies, lines_longer_than_80_chars, avoid_as, avoid_annotating_with_dynamic
mixin _$ContactViewModel on _ContactViewModelBase, Store {
final _$itemsAtom = Atom(name: '_ContactViewModelBase.items');
@override
ContactModel get items {
_$itemsAtom.reportRead();
return super.items;
}
@override
set items(ContactModel value) {
_$itemsAtom.reportWrite(value, super.items, () {
super.items = value;
});
}
final _$lenghtAtom = Atom(name: '_ContactViewModelBase.lenght');
@override
int get lenght {
_$lenghtAtom.reportRead();
return super.lenght;
}
@override
set lenght(int value) {
_$lenghtAtom.reportWrite(value, super.lenght, () {
super.lenght = value;
});
}
final _$fetchItemsAsyncAction =
AsyncAction('_ContactViewModelBase.fetchItems');
@override
Future<void> fetchItems(String token) {
return _$fetchItemsAsyncAction.run(() => super.fetchItems(token));
}
@override
String toString() {
return '''
items: ${items},
lenght: ${lenght}
''';
}
}
| 0 |
mirrored_repositories/crm_app/lib/feature/home/profile | mirrored_repositories/crm_app/lib/feature/home/profile/view/profile_tabbar_view.dart | import 'package:flutter/material.dart';
import 'package:kartal/kartal.dart';
import '../../bottomtab/model/bottomtab_model.dart';
import '../profile_edit/view/profile_edit_view.dart';
import 'my_profile_view.dart';
class ProfileTabbarView extends StatelessWidget {
const ProfileTabbarView({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
List<BottomTabModel> items = [
BottomTabModel(
title: "Hakkımda", icon: Icons.person, child: const MyProfileView()),
BottomTabModel(
title: "Düzenle", icon: Icons.edit, child: ProfileEditView()),
];
return DefaultTabController(
length: items.length,
child: Scaffold(
appBar: AppBar(
title: Image.network(
"http://192.168.3.53/assets/images/logo-light.png",
width: context.dynamicWidth(0.28),
),
centerTitle: true,
bottom: _buildTabBar(items, context),
),
body: _buildTabBarView(items),
),
);
}
TabBar _buildTabBar(List<BottomTabModel> items, BuildContext context) =>
TabBar(
unselectedLabelColor: context.colorScheme.onSurface,
tabs: _buildTabs(items),
indicatorColor: context.colorScheme.primary,
isScrollable: true,
);
List<Widget> _buildTabs(List<BottomTabModel> items) => List.generate(
items.length,
(index) => Tab(
text: items[index].title,
icon: Icon(items[index].icon),
),
);
TabBarView _buildTabBarView(List<BottomTabModel> items) => TabBarView(
children: items.map((e) => e.child).toList(),
);
}
| 0 |
mirrored_repositories/crm_app/lib/feature/home/profile | mirrored_repositories/crm_app/lib/feature/home/profile/view/my_profile_view.dart | // ignore_for_file: prefer_const_literals_to_create_immutables, prefer_const_constructors
import 'package:crm_app/core/components/text/body_text1_copy.dart';
import 'package:crm_app/core/components/text/body_text2_copy.dart';
import 'package:crm_app/core/components/text/bold_text.dart';
import 'package:crm_app/core/components/text/subtitle1_copy.dart';
import 'package:crm_app/core/constants/app/app_constants.dart';
import 'package:crm_app/core/init/theme/light/color_scheme_light.dart';
import 'package:crm_app/feature/home/company/view/company_view.dart';
import 'package:crm_app/feature/home/contact/view/contact_view.dart';
import 'package:crm_app/feature/home/profile/viewmodel/experience/experience_view_model.dart';
import 'package:crm_app/feature/home/profile/viewmodel/profile/profile_view_model.dart';
import 'package:dio/dio.dart';
import 'package:evil_icons_flutter/evil_icons_flutter.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/painting.dart';
import 'package:flutter_mobx/flutter_mobx.dart';
import 'package:flutter_slidable/flutter_slidable.dart';
import 'package:geira_icons/geira_icons.dart';
import 'package:kartal/kartal.dart';
class MyProfileView extends StatelessWidget {
const MyProfileView({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
MediaQueryData mediaQuery = MediaQuery.of(context);
double height = mediaQuery.size.height;
double radius = height * 0.02;
final ProfileViewModel _viewModel = ProfileViewModel();
final ExperienceViewModel _experienceViewModel = ExperienceViewModel();
_viewModel.fetchItems(ApplicationConstants.instance!.token, "");
return Scaffold(
body: Observer(
builder: (context) => SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: SizedBox(
height: context.dynamicHeight(1.6),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
flex: 3,
child: Padding(
padding: context.paddingLow,
child: Card(
elevation: 3,
child: Column(
children: [
context.emptySizedHeightBoxLow,
CircleAvatar(
radius: 45,
backgroundImage: NetworkImage(_viewModel
.items.photo ??
"http:/192.168.3.53/assets/images/users/user0.jpg"),
),
context.emptySizedHeightBoxLow,
BodyText1Copy(data: _viewModel.items.full_name ?? ""),
Text(_viewModel.items.user_name ?? ""),
context.emptySizedHeightBoxLow,
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
ElevatedButton(
onPressed: () {
Navigator.of(context).push(MaterialPageRoute(
builder: (context) => ContactView()));
},
child: Row(
children: [
Icon(
Icons.group,
color: ColorSchemeLight.instance.mandy,
),
context.emptySizedWidthBoxLow,
BodyText2Copy(
data: "Kişilerim",
color: ColorSchemeLight.instance.mandy),
],
),
style: ButtonStyle(
overlayColor:
MaterialStateProperty.resolveWith<Color>(
(Set<MaterialState> states) {
if (states
.contains(MaterialState.hovered)) {
return context.colorScheme.onBackground
.withOpacity(0.2);
}
if (states
.contains(MaterialState.focused) ||
states
.contains(MaterialState.pressed)) {
return context.colorScheme.onBackground
.withOpacity(0.2);
}
return Colors
.red; // Defer to the widget's default.
},
),
backgroundColor:
MaterialStateProperty.all<Color>(
ColorSchemeLight.instance.pippin),
),
),
context.emptySizedWidthBoxLow,
ElevatedButton(
onPressed: () {
Navigator.of(context).push(MaterialPageRoute(
builder: (context) => CompanyView()));
},
child: Row(
children: [
Icon(
Icons.apartment,
color: context.colorScheme.surface,
),
context.emptySizedWidthBoxLow,
BodyText2Copy(
data: "Firmalarım",
color: context.colorScheme.surface),
],
),
style: ButtonStyle(
overlayColor:
MaterialStateProperty.resolveWith<Color>(
(Set<MaterialState> states) {
if (states
.contains(MaterialState.hovered)) {
return context.colorScheme.surface
.withOpacity(0.2);
}
if (states
.contains(MaterialState.focused) ||
states
.contains(MaterialState.pressed)) {
return context.colorScheme.surface
.withOpacity(0.2);
}
return Colors
.red; // Defer to the widget's default.
},
),
backgroundColor:
MaterialStateProperty.all<Color>(
Color(0xffe8f4f8)),
),
),
],
),
context.emptySizedHeightBoxLow,
Padding(
padding: context.paddingNormal,
child: Row(
children: [
const Align(
alignment: Alignment.centerLeft,
child: BoldText(data: "HAKKIMDA: "),
),
context.emptySizedWidthBoxLow,
Align(
alignment: Alignment.centerLeft,
child: Text(_viewModel.items.detail ?? ""),
),
],
),
),
Padding(
padding: context.paddingNormal,
child: Row(
children: [
Align(
alignment: Alignment.centerLeft,
child: Text(
"Tam isim:",
style: TextStyle(fontWeight: FontWeight.bold),
),
),
context.emptySizedWidthBoxLow,
Align(
alignment: Alignment.centerLeft,
child: Text(_viewModel.items.full_name ?? ""),
),
],
),
),
Padding(
padding: context.paddingNormal,
child: Row(
// ignore:
children: [
Align(
alignment: Alignment.centerLeft,
child: Text(
"Telefon :",
style: TextStyle(fontWeight: FontWeight.bold),
),
),
context.emptySizedWidthBoxLow,
Align(
alignment: Alignment.centerLeft,
child: Text(_viewModel.items.telephone ??
"Geçerli telefon numarası bulunamadı."),
),
],
),
),
Padding(
padding: context.paddingNormal,
child: Row(
children: [
Align(
alignment: Alignment.centerLeft,
child: Text(
"Eposta :",
style: TextStyle(fontWeight: FontWeight.bold),
),
),
context.emptySizedWidthBoxLow,
Align(
alignment: Alignment.centerLeft,
child: Text(_viewModel.items.email ??
"Geçerli eposta adresi bulunamadi."),
),
],
),
),
Padding(
padding: context.paddingNormal,
child: Row(
children: [
Align(
alignment: Alignment.centerLeft,
child: Text(
"Şirket :",
style: TextStyle(fontWeight: FontWeight.bold),
),
),
context.emptySizedWidthBoxLow,
Align(
alignment: Alignment.centerLeft,
child:
Text(_viewModel.items.company_name ?? ""),
),
],
),
),
Padding(
padding: context.paddingNormal,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
CircleAvatar(
radius: 28,
child: Icon(
GIcons.instagram,
size: 48,
color: context.colorScheme.onSurface,
),
backgroundColor: Color(0xff9935B4),
),
CircleAvatar(
radius: 28,
child: Icon(
EvilIcons.sc_github,
size: 48,
color: context.colorScheme.onSurface,
),
backgroundColor:
context.colorScheme.secondaryVariant,
),
CircleAvatar(
radius: 28,
child: Icon(
EvilIcons.sc_linkedin,
size: 48,
color: context.colorScheme.onSurface,
),
backgroundColor: Color(0xff0A66C2),
),
CircleAvatar(
radius: 28,
child: Icon(
EvilIcons.sc_twitter,
size: 48,
color: context.colorScheme.onSurface,
),
backgroundColor: Color(0xff1DA1F2),
),
CircleAvatar(
radius: 28,
child: Icon(
EvilIcons.sc_facebook,
size: 48,
color: context.colorScheme.onSurface,
),
backgroundColor: Color(0xff17A8FD),
),
CircleAvatar(
radius: 28,
child: Icon(
Icons.language,
size: 48,
color: context.colorScheme.onSurface,
),
backgroundColor: context.colorScheme.onPrimary,
),
],
),
)
],
),
),
),
),
Expanded(
flex: 3,
child: Container(
padding: context.paddingLow,
child: Card(
elevation: 3,
child: Padding(
padding: context.paddingNormal,
child: Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Row(
children: [
Icon(Icons.work),
context.emptySizedWidthBoxLow,
BodyText1Copy(data: "DENEYİMLERİM"),
],
),
context.emptySizedHeightBoxLow3x,
Expanded(
child: ListView.builder(
physics: BouncingScrollPhysics(),
itemCount:
_experienceViewModel.items.timeline?.length ??
0,
itemBuilder: (context, index) => Column(
children: [
Slidable(
actionPane:
const SlidableDrawerActionPane(),
secondaryActions: [
IconSlideAction(
color:
context.colorScheme.primaryVariant,
caption: 'Sil',
icon: Icons.delete,
onTap: () {
_showDialog(context, radius,
_experienceViewModel, index);
},
),
IconSlideAction(
color: context.colorScheme.onPrimary,
foregroundColor:
context.colorScheme.onSurface,
caption: 'Düzenle',
icon: Icons.edit,
onTap: () {
_showModalBottomSheet(context, radius,
_experienceViewModel, false,
index: index);
},
),
],
child: ListTile(
leading: Icon(Icons.info),
title: BodyText2Copy(
data: _experienceViewModel
.items.timeline?[index].title ??
"",
fontWeight: FontWeight.bold,
),
subtitle: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Subtitle1Copy(
data: _experienceViewModel
.items
.timeline?[index]
.subtitle ??
""),
Subtitle1Copy(
data: _experienceViewModel
.items
.timeline?[index]
.detail ??
""),
],
),
trailing: Text(_experienceViewModel
.items.timeline?[index].date ??
""),
),
),
context.emptySizedHeightBoxLow,
Divider(
color: Colors.grey,
indent: 15,
endIndent: 15,
),
],
),
),
),
SizedBox(
width: context.dynamicWidth(0.352),
child: ElevatedButton(
onPressed: () {
_showModalBottomSheet(context, radius,
_experienceViewModel, true);
},
child: Row(
children: [
Icon(
Icons.note_add,
color: context.colorScheme.onError,
),
context.emptySizedHeightBoxLow,
Text(
"Deneyim Ekle",
style: TextStyle(
color: context.colorScheme.onError),
),
],
),
style: ButtonStyle(
overlayColor:
MaterialStateProperty.resolveWith<Color>(
(Set<MaterialState> states) {
if (states
.contains(MaterialState.hovered)) {
return context.colorScheme.onError
.withOpacity(0.2);
}
if (states
.contains(MaterialState.focused) ||
states
.contains(MaterialState.pressed)) {
return context.colorScheme.onError
.withOpacity(0.2);
}
return Colors
.red; // Defer to the widget's default.
},
),
backgroundColor:
MaterialStateProperty.all<Color>(
Color(0xffE6E6FA)),
),
),
),
context.emptySizedHeightBoxLow3x,
Expanded(
flex: 2,
child: Column(
children: [
Row(
children: [
Icon(Icons.task_alt),
context.emptySizedWidthBoxLow,
BodyText1Copy(data: "PROJELERİM"),
],
),
context.emptySizedHeightBoxLow3x,
],
),
)
],
),
),
),
),
),
],
),
),
),
));
}
_showModalBottomSheet(context, double radius,
ExperienceViewModel experienceViewModel, bool addOrEdit,
{int index = 0}) {
DateTime _now = DateTime.now();
var titleController = TextEditingController();
var subtitleController = TextEditingController();
var dateController = TextEditingController();
var detailController = TextEditingController();
showModalBottomSheet(
isScrollControlled: true,
context: context,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(radius),
),
builder: (BuildContext context) {
return Container(
height: context.dynamicHeight(0.75),
padding: context.paddingNormal,
decoration: BoxDecoration(
color: context.colorScheme.onSurface,
borderRadius: BorderRadius.only(
topLeft: context.highadius,
topRight: context.highadius,
),
),
child: Column(
children: [
Center(
child: Container(
height: context.dynamicWidth(0.03),
width: context.dynamicWidth(0.2),
decoration: BoxDecoration(
borderRadius: context.lowBorderRadius,
color: Colors.grey),
),
),
context.emptySizedHeightBoxLow3x,
Padding(
padding: context.paddingLow,
child: const Text("Başlık"),
),
TextField(
controller: titleController,
decoration: InputDecoration(
filled: true,
hintText: 'Örn: Bilgisayar Mühendisi',
enabledBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide: BorderSide(color: Colors.grey),
),
focusedBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide: BorderSide(color: context.colorScheme.surface),
),
),
cursorColor: context.colorScheme.onSecondary,
),
context.emptySizedHeightBoxLow,
Padding(
padding: context.paddingLow,
child: const Text("Şirket-Okul Adı"),
),
TextField(
controller: subtitleController,
decoration: InputDecoration(
filled: true,
hintText: 'Örn: Kuvarssoft',
enabledBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide: BorderSide(color: Colors.grey),
),
focusedBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide: BorderSide(color: context.colorScheme.surface),
),
),
cursorColor: context.colorScheme.onSecondary,
),
context.emptySizedHeightBoxLow,
Padding(
padding: context.paddingLow,
child: const Text("Tarih"),
),
TextField(
controller: dateController,
decoration: InputDecoration(
filled: true,
hintText: 'mm/dd/yy',
prefixIcon: IconButton(
onPressed: () {
showDatePicker(
context: context,
initialDate: _now,
firstDate: DateTime(DateTime.now().year - 5),
lastDate: DateTime(DateTime.now().year + 5),
);
},
icon: const Icon(Icons.calendar_today)),
enabledBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide: BorderSide(color: Colors.grey),
),
focusedBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide: BorderSide(color: context.colorScheme.surface),
),
),
cursorColor: context.colorScheme.onSecondary,
),
context.emptySizedHeightBoxLow,
Padding(
padding: context.paddingLow,
child: const Text("Detay"),
),
TextField(
controller: detailController,
decoration: InputDecoration(
filled: true,
enabledBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide: BorderSide(color: Colors.grey),
),
focusedBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide: BorderSide(color: context.colorScheme.surface),
),
),
cursorColor: context.colorScheme.onSecondary,
maxLines: 3,
),
context.emptySizedHeightBoxLow3x,
Divider(
color: Colors.grey,
),
Padding(
padding: context.paddingLow,
child: Row(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.end,
children: [
ElevatedButton(
onPressed: () {
Navigator.of(context).pop();
},
child: Row(
children: [
Icon(
Icons.close,
color: ColorSchemeLight.instance.mandy,
),
BodyText2Copy(
data: "Vazgeç",
color: ColorSchemeLight.instance.mandy,
),
],
),
style: ButtonStyle(
overlayColor: MaterialStateProperty.resolveWith<Color>(
(Set<MaterialState> states) {
if (states.contains(MaterialState.hovered)) {
return context.colorScheme.onError
.withOpacity(0.2);
}
if (states.contains(MaterialState.focused) ||
states.contains(MaterialState.pressed)) {
return context.colorScheme.onError
.withOpacity(0.2);
}
return Colors.red; // Defer to the widget's default.
},
),
backgroundColor: MaterialStateProperty.all<Color>(
ColorSchemeLight.instance.pippin),
),
),
context.emptySizedWidthBoxLow,
ElevatedButton(
onPressed: () async {
String token = ApplicationConstants.instance!.token;
Dio dio = Dio();
if (addOrEdit) {
await dio.post(
"http://192.168.3.53/api/Persons/new_timeline?token=$token&date=${dateController.text}&title=${titleController.text}&subtitle=${subtitleController.text}&detail=${detailController.text}");
experienceViewModel.fetchItems(token);
Navigator.of(context).pop();
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
backgroundColor:
context.colorScheme.secondaryVariant,
duration: context.durationSlow,
content: BodyText2Copy(
data: "Deneyim başarıyla eklendi !",
color: context.colorScheme.onSurface,
),
),
);
} else {
await dio.post(
"http://192.168.3.53/api/Persons/update_timeline?token=$token&id=${experienceViewModel.items.timeline?[index].id}&date=${dateController.text}&title=${titleController.text}&subtitle=${subtitleController.text}&detail=${detailController.text}");
experienceViewModel.fetchItems(token);
Navigator.of(context).pop();
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
backgroundColor:
context.colorScheme.secondaryVariant,
duration: context.durationSlow,
content: BodyText2Copy(
data: "Deneyim başarıyla düzenlendi !",
color: context.colorScheme.onSurface,
),
),
);
}
},
child: Row(
children: [
Icon(addOrEdit ? Icons.add : Icons.edit,
color: ColorSchemeLight.instance.java),
context.emptySizedWidthBoxLow,
BodyText2Copy(
data: addOrEdit ? "Ekle" : "Kaydet",
color: ColorSchemeLight.instance.java),
],
),
style: ElevatedButton.styleFrom(
primary: ColorSchemeLight.instance.hummingBird),
),
],
),
),
],
),
);
},
);
}
_showDialog(BuildContext context, double radius,
ExperienceViewModel viewModel, int index) {
showDialog(
context: context,
builder: (context) => AlertDialog(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(radius),
),
title: const BodyText1Copy(
data: "Deneyimi silmek istediğinizden emin misiniz ?"),
content: const BodyText2Copy(
data: "Deneyim kalıcı olarak silinecektir."),
actions: [
ElevatedButton(
child: Text("Evet",
style: TextStyle(color: context.colorScheme.onSurface)),
style: ElevatedButton.styleFrom(
primary: context.colorScheme.primaryVariant),
onPressed: () async {
String token = ApplicationConstants.instance!.token;
final Dio dio = Dio();
await dio.post(
"http://192.168.3.53/api/Persons/delete_timeline?token=$token&id=${viewModel.items.timeline?[index].id}");
Navigator.of(context).pop();
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
backgroundColor: context.colorScheme.secondaryVariant,
duration: context.durationSlow,
content: BodyText2Copy(
data: "Deneyim başarıyla silindi !",
color: context.colorScheme.onSurface,
),
),
);
viewModel.fetchItems(token);
},
),
ElevatedButton(
onPressed: () {
Navigator.of(context).pop();
},
style: ElevatedButton.styleFrom(
primary: context.colorScheme.secondaryVariant),
child: Text(
"Hayır",
style: TextStyle(color: context.colorScheme.onSurface),
),
)
],
));
}
}
| 0 |
mirrored_repositories/crm_app/lib/feature/home/profile | mirrored_repositories/crm_app/lib/feature/home/profile/view/profile_view.dart | import '../../../../core/components/text/body_text1_copy.dart';
import '../../../../core/components/text/body_text2_copy.dart';
import '../../../../core/components/text/bold_text.dart';
import '../../../../core/constants/app/app_constants.dart';
import '../viewmodel/profile/profile_view_model.dart';
import 'package:evil_icons_flutter/evil_icons_flutter.dart';
import 'package:flutter/material.dart';
import 'package:flutter_mobx/flutter_mobx.dart';
import 'package:geira_icons/geira_icons.dart';
import 'package:kartal/kartal.dart';
class ProfileView extends StatelessWidget {
final ProfileViewModel _viewModel = ProfileViewModel();
final String username;
ProfileView({Key? key, required this.username}) : super(key: key) {
_viewModel.fetchItems(ApplicationConstants.instance!.token, username);
}
@override
Widget build(BuildContext context) {
return Observer(
builder: (context) {
return Card(
elevation: 3,
child: Padding(
padding: context.paddingLow,
child: Column(
children: [
context.emptySizedHeightBoxLow,
CircleAvatar(
radius: 45,
backgroundImage: NetworkImage(_viewModel.items.photo ??
""),
),
context.emptySizedHeightBoxLow,
BodyText1Copy(data: _viewModel.items.full_name ?? ""),
Text(_viewModel.items.user_name ?? ""),
context.emptySizedHeightBoxLow,
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
ElevatedButton(
onPressed: () {},
child: BodyText2Copy(
data: "Follow", color: context.colorScheme.onSurface),
),
context.emptySizedWidthBoxLow,
ElevatedButton(
onPressed: () {},
child: BodyText2Copy(
data: "Message",
color: context.colorScheme.onSurface),
style: ElevatedButton.styleFrom(
primary: context.colorScheme.primaryVariant),
),
],
),
context.emptySizedHeightBoxLow,
Padding(
padding: context.paddingNormal,
child: Row(
children: [
const Align(
alignment: Alignment.centerLeft,
child: BoldText(data: "HAKKIMDA: "),
),
context.emptySizedWidthBoxLow,
Align(
alignment: Alignment.centerLeft,
child: Text(_viewModel.items.detail ?? ""),
),
],
),
),
Padding(
padding: context.paddingNormal,
child: Row(
children: [
Align(
alignment: Alignment.centerLeft,
child: Text(
"Tam isim:",
style: TextStyle(
color: context.colorScheme.primary,
fontWeight: FontWeight.bold),
),
),
context.emptySizedWidthBoxLow,
Align(
alignment: Alignment.centerLeft,
child: Text(_viewModel.items.full_name ?? ""),
),
],
),
),
Padding(
padding: context.paddingNormal,
child: Row(
// ignore:
children: [
Align(
alignment: Alignment.centerLeft,
child: Text(
"Telefon :",
style: TextStyle(
color: context.colorScheme.onBackground,
fontWeight: FontWeight.bold),
),
),
context.emptySizedWidthBoxLow,
Align(
alignment: Alignment.centerLeft,
child: Text(_viewModel.items.telephone ??
"Geçerli telefon numarası bulunamadı."),
),
],
),
),
Padding(
padding: context.paddingNormal,
child: Row(
children: [
Align(
alignment: Alignment.centerLeft,
child: Text(
"Eposta :",
style: TextStyle(
color: context.colorScheme.onBackground,
fontWeight: FontWeight.bold),
),
),
context.emptySizedWidthBoxLow,
Align(
alignment: Alignment.centerLeft,
child: Text(_viewModel.items.email ??
"Geçerli eposta adresi bulunamadi."),
),
],
),
),
Padding(
padding: context.paddingNormal,
child: Row(
children: [
Align(
alignment: Alignment.centerLeft,
child: Text(
"Şirket :",
style: TextStyle(
color: context.colorScheme.onBackground,
fontWeight: FontWeight.bold),
),
),
context.emptySizedWidthBoxLow,
Align(
alignment: Alignment.centerLeft,
child: Text(_viewModel.items.company_name ?? ""),
),
],
),
),
Padding(
padding: context.paddingNormal,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
CircleAvatar(
radius: 30,
child: Icon(
GIcons.instagram,
size: 48,
color: context.colorScheme.onSurface,
),
backgroundColor: const Color(0xff9935B4),
),
CircleAvatar(
radius: 30,
child: Icon(
EvilIcons.sc_github,
size: 48,
color: context.colorScheme.onSurface,
),
backgroundColor: context.colorScheme.secondaryVariant,
),
CircleAvatar(
radius: 30,
child: Icon(
EvilIcons.sc_linkedin,
size: 48,
color: context.colorScheme.onSurface,
),
backgroundColor: const Color(0xff0A66C2),
),
CircleAvatar(
radius: 30,
child: Icon(
EvilIcons.sc_twitter,
size: 48,
color: context.colorScheme.onSurface,
),
backgroundColor: const Color(0xff1DA1F2),
),
CircleAvatar(
radius: 30,
child: Icon(
EvilIcons.sc_facebook,
size: 48,
color: context.colorScheme.onSurface,
),
backgroundColor: const Color(0xff17A8FD),
),
CircleAvatar(
radius: 30,
child: Icon(
Icons.language,
size: 48,
color: context.colorScheme.onSurface,
),
backgroundColor: context.colorScheme.onPrimary,
),
],
),
)
],
),
),
);
},
);
}
}
| 0 |
mirrored_repositories/crm_app/lib/feature/home/profile/model | mirrored_repositories/crm_app/lib/feature/home/profile/model/experience/experience_model.dart | import 'package:json_annotation/json_annotation.dart';
part 'experience_model.g.dart';
@JsonSerializable()
class ExperienceModel {
String? message;
String? userid;
List<Timeline>? timeline;
ExperienceModel({this.message, this.userid, this.timeline});
factory ExperienceModel.fromJson(Map<String, dynamic> json) => _$ExperienceModelFromJson(json);
Map<String, dynamic> toJson() => _$ExperienceModelToJson(this);
}
@JsonSerializable()
class Timeline {
String? id;
String? date;
String? title;
String? subtitle;
String? detail;
Timeline({this.id, this.date, this.title, this.subtitle, this.detail});
factory Timeline.fromJson(Map<String, dynamic> json) => _$TimelineFromJson(json);
Map<String, dynamic> toJson() => _$TimelineToJson(this);
}
| 0 |
mirrored_repositories/crm_app/lib/feature/home/profile/model | mirrored_repositories/crm_app/lib/feature/home/profile/model/experience/experience_model.g.dart | // GENERATED CODE - DO NOT MODIFY BY HAND
part of 'experience_model.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
ExperienceModel _$ExperienceModelFromJson(Map<String, dynamic> json) {
return ExperienceModel(
message: json['message'] as String?,
userid: json['userid'] as String?,
timeline: (json['timeline'] as List<dynamic>?)
?.map((e) => Timeline.fromJson(e as Map<String, dynamic>))
.toList(),
);
}
Map<String, dynamic> _$ExperienceModelToJson(ExperienceModel instance) =>
<String, dynamic>{
'message': instance.message,
'userid': instance.userid,
'timeline': instance.timeline,
};
Timeline _$TimelineFromJson(Map<String, dynamic> json) {
return Timeline(
id: json['id'] as String?,
date: json['date'] as String?,
title: json['title'] as String?,
subtitle: json['subtitle'] as String?,
detail: json['detail'] as String?,
);
}
Map<String, dynamic> _$TimelineToJson(Timeline instance) => <String, dynamic>{
'id': instance.id,
'date': instance.date,
'title': instance.title,
'subtitle': instance.subtitle,
'detail': instance.detail,
};
| 0 |
mirrored_repositories/crm_app/lib/feature/home/profile/model | mirrored_repositories/crm_app/lib/feature/home/profile/model/profile/profile_model.g.dart | // GENERATED CODE - DO NOT MODIFY BY HAND
part of 'profile_model.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
ProfileModel _$ProfileModelFromJson(Map<String, dynamic> json) {
return ProfileModel(
message: json['message'] as String?,
userid: json['userid'] as String?,
user_name: json['user_name'] as String?,
full_name: json['full_name'] as String?,
email: json['email'] as String?,
photo: json['photo'] as String?,
is_active: json['is_active'] as String?,
telephone: json['telephone'] as String?,
detail: json['detail'] as String?,
company_name: json['company_name'] as String?,
job: json['job'] as String?,
birthday: json['birthday'] as String?,
added: json['added'] as String?,
updated: json['updated'] as String?,
web_site: json['web_site'] as String?,
location: json['location'] as String?,
instagram: json['instagram'] as String?,
linkedin: json['linkedin'] as String?,
github: json['github'] as String?,
twitter: json['twitter'] as String?,
facebook: json['facebook'] as String?,
);
}
Map<String, dynamic> _$ProfileModelToJson(ProfileModel instance) =>
<String, dynamic>{
'message': instance.message,
'userid': instance.userid,
'user_name': instance.user_name,
'full_name': instance.full_name,
'email': instance.email,
'photo': instance.photo,
'is_active': instance.is_active,
'telephone': instance.telephone,
'detail': instance.detail,
'company_name': instance.company_name,
'job': instance.job,
'birthday': instance.birthday,
'added': instance.added,
'updated': instance.updated,
'web_site': instance.web_site,
'location': instance.location,
'instagram': instance.instagram,
'linkedin': instance.linkedin,
'github': instance.github,
'twitter': instance.twitter,
'facebook': instance.facebook,
};
| 0 |
mirrored_repositories/crm_app/lib/feature/home/profile/model | mirrored_repositories/crm_app/lib/feature/home/profile/model/profile/profile_model.dart | // ignore_for_file: non_constant_identifier_names
import 'package:json_annotation/json_annotation.dart';
part 'profile_model.g.dart';
@JsonSerializable()
class ProfileModel {
String? message;
String? userid;
String? user_name;
String? full_name;
String? email;
String? photo;
String? is_active;
String? telephone;
String? detail;
String? company_name;
String? job;
String? birthday;
String? added;
String? updated;
String? web_site;
String? location;
String? instagram;
String? linkedin;
String? github;
String? twitter;
String? facebook;
ProfileModel(
{this.message,
this.userid,
this.user_name,
this.full_name,
this.email,
this.photo,
this.is_active,
this.telephone,
this.detail,
this.company_name,
this.job,
this.birthday,
this.added,
this.updated,
this.web_site,
this.location,
this.instagram,
this.linkedin,
this.github,
this.twitter,
this.facebook});
factory ProfileModel.fromJson(Map<String, dynamic> json) =>
_$ProfileModelFromJson(json);
Map<String, dynamic> toJson() => _$ProfileModelToJson(this);
}
| 0 |
mirrored_repositories/crm_app/lib/feature/home/profile/service | mirrored_repositories/crm_app/lib/feature/home/profile/service/experience/experience_service.dart | import 'dart:io';
import '../../model/experience/experience_model.dart';
import 'package:dio/dio.dart';
import 'experience_service_endpoints.dart';
import 'i_experience_service.dart';
class ExperienceService extends IExperienceService {
ExperienceService(Dio dio) : super(dio);
@override
Future<ExperienceModel> fetchAllTask(String token) async {
final response =
await dio.get(ExperienceServiceEndPoints.experience.rawValue(token));
if (response.statusCode == HttpStatus.ok) {
return ExperienceModel.fromJson(response.data);
}
return ExperienceModel();
}
}
| 0 |
mirrored_repositories/crm_app/lib/feature/home/profile/service | mirrored_repositories/crm_app/lib/feature/home/profile/service/experience/i_experience_service.dart | import 'package:dio/dio.dart';
import '../../model/experience/experience_model.dart';
abstract class IExperienceService {
final Dio dio;
IExperienceService(this.dio);
Future<ExperienceModel> fetchAllTask(String token);
} | 0 |
mirrored_repositories/crm_app/lib/feature/home/profile/service | mirrored_repositories/crm_app/lib/feature/home/profile/service/experience/experience_service_endpoints.dart | enum ExperienceServiceEndPoints { experience }
extension ExperienceServiceExtension on ExperienceServiceEndPoints {
String rawValue(String token) {
switch (this) {
case ExperienceServiceEndPoints.experience:
return 'Persons/get_timeline?token=$token';
}
}
}
| 0 |
mirrored_repositories/crm_app/lib/feature/home/profile/service | mirrored_repositories/crm_app/lib/feature/home/profile/service/profile/profile_service_end_points.dart | enum ProfileServiceEndPoints { myProfile, profile }
extension ProjectDetailServiceExtension on ProfileServiceEndPoints {
String rawValue(String token, String username) {
switch (this) {
case ProfileServiceEndPoints.myProfile:
return 'Persons/get_my_profile?token=$token';
case ProfileServiceEndPoints.profile:
return 'Persons/get_profile?user_name=$username&token=$token';
}
}
}
| 0 |
mirrored_repositories/crm_app/lib/feature/home/profile/service | mirrored_repositories/crm_app/lib/feature/home/profile/service/profile/profile_service.dart | import 'dart:io';
import '../../model/profile/profile_model.dart';
import 'profile_service_end_points.dart';
import 'package:dio/dio.dart';
import 'i_profile_service.dart';
class ProfileService extends IProfileService {
ProfileService(Dio dio) : super(dio);
@override
Future<ProfileModel> fetchAllTask(String token, String username) async {
if (username == "") {
final response = await dio
.get(ProfileServiceEndPoints.myProfile.rawValue(token, username));
if (response.statusCode == HttpStatus.ok) {
return ProfileModel.fromJson(response.data);
}
} else {
final response = await dio
.get(ProfileServiceEndPoints.profile.rawValue(token, username));
if (response.statusCode == HttpStatus.ok) {
return ProfileModel.fromJson(response.data);
}
}
return ProfileModel();
}
}
| 0 |
mirrored_repositories/crm_app/lib/feature/home/profile/service | mirrored_repositories/crm_app/lib/feature/home/profile/service/profile/i_profile_service.dart | import 'package:dio/dio.dart';
import '../../model/profile/profile_model.dart';
abstract class IProfileService {
final Dio dio;
IProfileService(this.dio);
Future<ProfileModel> fetchAllTask(String token,String username);
} | 0 |
mirrored_repositories/crm_app/lib/feature/home/profile/profile_edit | mirrored_repositories/crm_app/lib/feature/home/profile/profile_edit/view/profile_edit_view.dart | // ignore_for_file: must_be_immutable, prefer_const_constructors
import 'package:crm_app/core/components/text/body_text1_copy.dart';
import 'package:crm_app/core/components/text/body_text2_copy.dart';
import 'package:crm_app/core/constants/app/app_constants.dart';
import 'package:crm_app/core/init/theme/light/color_scheme_light.dart';
import 'package:crm_app/feature/home/profile/viewmodel/profile/profile_view_model.dart';
import 'package:flutter_mobx/flutter_mobx.dart';
import 'package:evil_icons_flutter/evil_icons_flutter.dart';
import 'package:flutter/material.dart';
import 'package:geira_icons/geira_icons.dart';
import 'package:kartal/kartal.dart';
class ProfileEditView extends StatelessWidget {
final ProfileViewModel _viewModel = ProfileViewModel();
String name = "";
String phone = "";
String detail = "";
String location = "";
String birthDay = "";
String job = "";
String webSite = "";
String instagram = "";
String linkedIn = "";
String gitHub = "";
String twitter = "";
String facebook = "";
ProfileEditView({Key? key}) : super(key: key) {
_viewModel.fetchItems(ApplicationConstants.instance!.token, "");
}
@override
Widget build(BuildContext context) {
DateTime now = DateTime.now();
return Scaffold(
body: Observer(
builder: (context) => SingleChildScrollView(
physics: const BouncingScrollPhysics(),
child: SizedBox(
height: context.dynamicHeight(2.1),
child: Padding(
padding: context.paddingNormal,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
context.emptySizedHeightBoxLow,
Row(
children: [
const Icon(
Icons.account_circle,
),
context.emptySizedWidthBoxLow,
const BodyText1Copy(
data: "KİŞİSEL BİLGİLER",
),
],
),
context.emptySizedHeightBoxLow3x,
Padding(
padding: context.paddingLow,
child: const Text("İsim:"),
),
context.emptySizedHeightBoxLow,
TextFormField(
initialValue: _viewModel.items.full_name,
decoration: InputDecoration(
filled: true,
prefixIcon: const Icon(Icons.person),
labelText: 'İsim giriniz.',
enabledBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide:
BorderSide(color: Colors.grey),
),
focusedBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide:
BorderSide(color: context.colorScheme.onSecondary),
),
),
cursorColor: context.colorScheme.onSecondary,
onSaved: (value) => name = value!,
),
context.emptySizedHeightBoxLow,
Padding(
padding: context.paddingLow,
child: const Text("Telefon:"),
),
context.emptySizedHeightBoxLow,
TextFormField(
initialValue: _viewModel.items.telephone,
keyboardType: TextInputType.phone,
decoration: InputDecoration(
filled: true,
prefixIcon: const Icon(Icons.phone),
hintText: _viewModel.items.telephone ??
'Telefon numarası giriniz.',
labelText: 'Telefon numarası giriniz.',
enabledBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide:
BorderSide(color: Colors.grey),
),
focusedBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide:
BorderSide(color: context.colorScheme.surface),
),
),
cursorColor: context.colorScheme.onSecondary,
onSaved: (value) => phone = value!,
),
context.emptySizedHeightBoxLow,
// Padding(
// padding: context.paddingLow,
// child: const Text("Kullanıcı Adı:"),
// ),
// TextField(
// decoration: InputDecoration(
// hintText: _viewModel.items.user_name ??
// "Kullanıcı adı giriniz.",
// enabledBorder: OutlineInputBorder(
// borderRadius: context.lowBorderRadius,
// borderSide:
// BorderSide(color: Colors.grey),
// ),
// focusedBorder: OutlineInputBorder(
// borderRadius: context.lowBorderRadius,
// borderSide:
// BorderSide(color: context.colorScheme.surface),
// ),
// ),
// cursorColor: context.colorScheme.onSecondary,
// ),
// context.emptySizedHeightBoxLow,
Padding(
padding: context.paddingLow,
child: const Text("Kısaca Hakkınızda:"),
),
context.emptySizedHeightBoxLow,
TextFormField(
initialValue: _viewModel.items.detail,
decoration: InputDecoration(
filled: true,
prefixIcon: const Icon(Icons.description),
hintText: _viewModel.items.detail ??
"Hakkınzda kısa bilgi giriniz.",
labelText: 'Hakkınızda',
enabledBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide:
BorderSide(color: Colors.grey),
),
focusedBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide:
BorderSide(color: context.colorScheme.surface),
),
),
cursorColor: context.colorScheme.onSecondary,
maxLines: 6,
onSaved: (value) => detail = value!,
),
context.emptySizedHeightBoxLow,
Padding(
padding: context.paddingLow,
child: const Text("Konum:"),
),
context.emptySizedHeightBoxLow,
TextFormField(
initialValue: _viewModel.items.location,
decoration: InputDecoration(
filled: true,
prefixIcon: const Icon(Icons.location_on),
hintText: "Konumuzu giriniz.",
labelText: 'Konum',
enabledBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide:
BorderSide(color: Colors.grey),
),
focusedBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide:
BorderSide(color: context.colorScheme.surface),
),
),
cursorColor: context.colorScheme.onSecondary,
onSaved: (value) => location = value!,
),
context.emptySizedHeightBoxLow,
Padding(
padding: context.paddingLow,
child: const Text("Başlama Tarihi"),
),
TextFormField(
initialValue: _viewModel.items.birthday,
decoration: InputDecoration(
filled: true,
hintText: 'mm/dd/yy',
prefixIcon: IconButton(
onPressed: () {
showDatePicker(
context: context,
initialDate: now,
firstDate: DateTime(DateTime.now().year - 5),
lastDate: DateTime(DateTime.now().year + 5),
);
},
icon: const Icon(Icons.calendar_today)),
enabledBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide:
BorderSide(color: Colors.grey),
),
focusedBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide:
BorderSide(color: context.colorScheme.surface),
),
),
cursorColor: context.colorScheme.onSecondary,
onSaved: (value) => birthDay = value!,
),
context.emptySizedHeightBoxLow3x,
Center(
child: Container(
width: double.infinity,
height: context.dynamicHeight(0.05),
padding: context.paddingLow,
color: Color(0xffC0C0C0),
child: Wrap(
// ignore: prefer_const_literals_to_create_immutables
crossAxisAlignment: WrapCrossAlignment.center,
spacing: 5,
// ignore: prefer_const_literals_to_create_immutables
children: [
const Icon(Icons.business),
const BodyText2Copy(
data: "ŞİRKET BİLGİLERİ",
fontWeight: FontWeight.bold,
)
],
),
),
),
context.emptySizedHeightBoxLow3x,
Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Padding(
padding: context.paddingLow,
child: const Text("Şirket:"),
),
Padding(
padding: context.paddingLow,
child: const Text("Meslek:"),
),
],
),
context.emptySizedHeightBoxLow,
Row(
children: [
Expanded(
child: TextFormField(
initialValue: _viewModel.items.company_name,
decoration: InputDecoration(
filled: true,
prefixIcon: const Icon(Icons.business),
hintText: "Şirket ismi giriniz.",
labelText: 'Şirket ismi',
enabledBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide: BorderSide(
color: Colors.grey),
),
focusedBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide: BorderSide(
color: context.colorScheme.surface),
),
),
cursorColor: context.colorScheme.onSecondary,
),
),
context.emptySizedWidthBoxLow3x,
Expanded(
child: TextFormField(
initialValue: _viewModel.items.job,
decoration: InputDecoration(
filled: true,
prefixIcon: const Icon(Icons.work),
hintText: "Meslek giriniz.",
labelText: 'Meslek',
enabledBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide: BorderSide(
color: Colors.grey),
),
focusedBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide: BorderSide(
color: context.colorScheme.surface),
),
),
cursorColor: context.colorScheme.onSecondary,
onSaved: (value) => job = value!,
),
),
],
),
],
),
context.emptySizedHeightBoxLow3x,
Center(
child: Container(
width: double.infinity,
height: context.dynamicHeight(0.05),
padding: context.paddingLow,
color: Color(0xffC0C0C0),
child: Wrap(
// ignore: prefer_const_literals_to_create_immutables
crossAxisAlignment: WrapCrossAlignment.center,
spacing: 5,
// ignore: prefer_const_literals_to_create_immutables
children: [
const Icon(Icons.public),
const BodyText2Copy(
data: "SOSYAL MEDYA",
fontWeight: FontWeight.bold,
)
],
),
),
),
context.emptySizedHeightBoxLow3x,
Padding(
padding: context.paddingLow,
child: const Text("Kişisel Siteniz"),
),
TextFormField(
initialValue: _viewModel.items.web_site,
decoration: InputDecoration(
filled: true,
hintText: 'Url',
prefixIcon: const Icon(Icons.language),
enabledBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide:
BorderSide(color: Colors.grey),
),
focusedBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide:
BorderSide(color: context.colorScheme.surface),
),
),
cursorColor: context.colorScheme.onSecondary,
onSaved: (value) => webSite = value!,
),
context.emptySizedHeightBoxLow,
Padding(
padding: context.paddingLow,
child: const Text("Instagram"),
),
TextFormField(
initialValue: _viewModel.items.instagram,
decoration: InputDecoration(
filled: true,
hintText: 'Url',
prefixIcon: const Icon(
GIcons.instagram,
size: 34,
),
enabledBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide:
BorderSide(color: Colors.grey),
),
focusedBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide:
BorderSide(color: context.colorScheme.surface),
),
),
cursorColor: context.colorScheme.onSecondary,
onSaved: (value) => instagram = value!,
),
context.emptySizedHeightBoxLow,
Padding(
padding: context.paddingLow,
child: const Text("Linkedin"),
),
TextFormField(
initialValue: _viewModel.items.linkedin,
decoration: InputDecoration(
filled: true,
hintText: 'Url',
prefixIcon: const Icon(
EvilIcons.sc_linkedin,
),
enabledBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide:
BorderSide(color: Colors.grey),
),
focusedBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide:
BorderSide(color: context.colorScheme.surface),
),
),
cursorColor: context.colorScheme.onSecondary,
onSaved: (value) => linkedIn = value!,
),
context.emptySizedHeightBoxLow,
Padding(
padding: context.paddingLow,
child: const Text("Github"),
),
TextFormField(
initialValue: _viewModel.items.github,
decoration: InputDecoration(
filled: true,
hintText: 'Url',
prefixIcon: const Icon(EvilIcons.sc_github),
enabledBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide:
BorderSide(color: Colors.grey),
),
focusedBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide:
BorderSide(color: context.colorScheme.surface),
),
),
cursorColor: context.colorScheme.onSecondary,
onSaved: (value) => gitHub = value!,
),
context.emptySizedHeightBoxLow,
Padding(
padding: context.paddingLow,
child: const Text("Twitter"),
),
TextFormField(
initialValue: _viewModel.items.twitter,
decoration: InputDecoration(
filled: true,
hintText: 'Url',
prefixIcon: const Icon(EvilIcons.sc_twitter),
enabledBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide:
BorderSide(color: Colors.grey),
),
focusedBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide:
BorderSide(color: context.colorScheme.surface),
),
),
cursorColor: context.colorScheme.onSecondary,
onSaved: (value) => twitter = value!,
),
context.emptySizedHeightBoxLow,
Padding(
padding: context.paddingLow,
child: const Text("Facebook"),
),
TextFormField(
initialValue: _viewModel.items.facebook,
decoration: InputDecoration(
filled: true,
hintText: 'Url',
prefixIcon: const Icon(EvilIcons.sc_facebook),
enabledBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide:
BorderSide(color: Colors.grey),
),
focusedBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide:
BorderSide(color: context.colorScheme.surface),
),
),
cursorColor: context.colorScheme.onSecondary,
onSaved: (value) => facebook = value!,
),
context.emptySizedHeightBoxLow,
Align(
alignment: Alignment.bottomRight,
child: SizedBox(
width: context.dynamicWidth(0.25),
child: ElevatedButton(
onPressed: () async {
debugPrint(name);
// String token = ApplicationConstants.instance!.token;
// Dio dio = Dio();
// await dio.post(
// "http://192.168.3.53/api/Persons/update_my_profile?token=$token&full_name=${nameController.text}&telephone=${phoneController.text}&detail=${detailController.text}&company_id=1&job=${jobController.text}&birthday=${birthDayController.text}&web_site=${webSiteController.text}&location=${locationController.text}&instagram=${instagramController.text}&linkedin=${linkedInController.text}&github=${gitHubController.text}&twitter=${twitterController.text}&facebook=${facebookController.text}");
// _viewModel.fetchItems(token, "");
// ScaffoldMessenger.of(context).showSnackBar(
// SnackBar(
// backgroundColor:
// context.colorScheme.secondaryVariant,
// duration: context.durationSlow,
// content: BodyText2Copy(
// data: "Profil bilgileri başarıyla güncellendi !",
// color: context.colorScheme.onSurface,
// ),
// ),
// );
},
child: Row(
children: [
Icon(Icons.save,color: ColorSchemeLight.instance.java),
context.emptySizedHeightBoxLow3x,
BodyText2Copy(
data: "Kaydet", color: ColorSchemeLight.instance.java),
],
),
style: ElevatedButton.styleFrom(
primary: ColorSchemeLight.instance.hummingBird)
),
),
),
],
),
),
),
),
),
);
}
}
| 0 |
mirrored_repositories/crm_app/lib/feature/home/profile/viewmodel | mirrored_repositories/crm_app/lib/feature/home/profile/viewmodel/experience/experience_view_model.g.dart | // GENERATED CODE - DO NOT MODIFY BY HAND
part of 'experience_view_model.dart';
// **************************************************************************
// StoreGenerator
// **************************************************************************
// ignore_for_file: non_constant_identifier_names, unnecessary_brace_in_string_interps, unnecessary_lambdas, prefer_expression_function_bodies, lines_longer_than_80_chars, avoid_as, avoid_annotating_with_dynamic
mixin _$ExperienceViewModel on _ExperienceViewModelBase, Store {
final _$itemsAtom = Atom(name: '_ExperienceViewModelBase.items');
@override
ExperienceModel get items {
_$itemsAtom.reportRead();
return super.items;
}
@override
set items(ExperienceModel value) {
_$itemsAtom.reportWrite(value, super.items, () {
super.items = value;
});
}
final _$fetchItemsAsyncAction =
AsyncAction('_ExperienceViewModelBase.fetchItems');
@override
Future<void> fetchItems(String token) {
return _$fetchItemsAsyncAction.run(() => super.fetchItems(token));
}
@override
String toString() {
return '''
items: ${items}
''';
}
}
| 0 |
mirrored_repositories/crm_app/lib/feature/home/profile/viewmodel | mirrored_repositories/crm_app/lib/feature/home/profile/viewmodel/experience/experience_view_model.dart |
import '../../../../../core/constants/app/app_constants.dart';
import '../../../../../core/init/network/network_manager.dart';
import '../../model/experience/experience_model.dart';
import '../../service/experience/experience_service.dart';
import '../../service/experience/i_experience_service.dart';
import 'package:flutter/material.dart';
import 'package:mobx/mobx.dart';
part 'experience_view_model.g.dart';
class ExperienceViewModel = _ExperienceViewModelBase with _$ExperienceViewModel;
abstract class _ExperienceViewModelBase with Store {
BuildContext? context;
late IExperienceService experienceService;
@observable
ExperienceModel items = ExperienceModel();
_ExperienceViewModelBase() {
experienceService = ExperienceService(NetworkManager.instance!.dio);
fetchItems(ApplicationConstants.instance!.token);
}
void setContext(BuildContext context) {
this.context = context;
}
@action
Future<void> fetchItems(String token) async {
items = await experienceService.fetchAllTask(token);
}
} | 0 |
mirrored_repositories/crm_app/lib/feature/home/profile/viewmodel | mirrored_repositories/crm_app/lib/feature/home/profile/viewmodel/profile/profile_view_model.dart | import '../../../../../core/init/network/network_manager.dart';
import '../../model/profile/profile_model.dart';
import '../../service/profile/i_profile_service.dart';
import '../../service/profile/profile_service.dart';
import 'package:flutter/material.dart';
import 'package:mobx/mobx.dart';
part 'profile_view_model.g.dart';
class ProfileViewModel = _ProfileViewModelBase with _$ProfileViewModel;
abstract class _ProfileViewModelBase with Store {
BuildContext? context;
late IProfileService profileService;
@observable
ProfileModel items = ProfileModel();
_ProfileViewModelBase() {
profileService = ProfileService(NetworkManager.instance!.dio);
}
void setContext(BuildContext context) {
this.context = context;
}
@action
Future<void> fetchItems(String token, String username) async {
items = await profileService.fetchAllTask(token, username);
}
}
| 0 |
mirrored_repositories/crm_app/lib/feature/home/profile/viewmodel | mirrored_repositories/crm_app/lib/feature/home/profile/viewmodel/profile/profile_view_model.g.dart | // GENERATED CODE - DO NOT MODIFY BY HAND
part of 'profile_view_model.dart';
// **************************************************************************
// StoreGenerator
// **************************************************************************
// ignore_for_file: non_constant_identifier_names, unnecessary_brace_in_string_interps, unnecessary_lambdas, prefer_expression_function_bodies, lines_longer_than_80_chars, avoid_as, avoid_annotating_with_dynamic
mixin _$ProfileViewModel on _ProfileViewModelBase, Store {
final _$itemsAtom = Atom(name: '_ProfileViewModelBase.items');
@override
ProfileModel get items {
_$itemsAtom.reportRead();
return super.items;
}
@override
set items(ProfileModel value) {
_$itemsAtom.reportWrite(value, super.items, () {
super.items = value;
});
}
final _$fetchItemsAsyncAction =
AsyncAction('_ProfileViewModelBase.fetchItems');
@override
Future<void> fetchItems(String token, String username) {
return _$fetchItemsAsyncAction.run(() => super.fetchItems(token, username));
}
@override
String toString() {
return '''
items: ${items}
''';
}
}
| 0 |
mirrored_repositories/crm_app/lib/feature/home/mail | mirrored_repositories/crm_app/lib/feature/home/mail/view/mail_view.dart | // ignore_for_file: prefer_const_constructors
import 'package:crm_app/core/components/text/subtitle1_copy.dart';
import 'package:crm_app/core/init/theme/light/color_scheme_light.dart';
import 'package:flutter_html/flutter_html.dart';
import '../../../../core/components/text/body_text1_copy.dart';
import '../../../../core/components/text/body_text2_copy.dart';
import '../../../../core/constants/app/app_constants.dart';
import 'package:dio/dio.dart';
import 'send_mail/view/send_mail_view.dart';
import '../viewmodel/mail_view_model.dart';
import 'package:flutter_mobx/flutter_mobx.dart';
import 'package:flutter/material.dart';
import 'package:flutter_slidable/flutter_slidable.dart';
import 'package:kartal/kartal.dart';
class MailView extends StatelessWidget {
final MailViewModel viewModel;
final String title;
const MailView({Key? key, required this.viewModel, required this.title})
: super(key: key);
@override
Widget build(BuildContext context) {
String token = ApplicationConstants.instance!.token;
MediaQueryData mediaQuery = MediaQuery.of(context);
double height = mediaQuery.size.height;
double radius = height * 0.02;
return Scaffold(
resizeToAvoidBottomInset: false,
appBar: AppBar(
title: Text(
title,
style: TextStyle(color: context.colorScheme.onSecondary),
),
backgroundColor: Colors.transparent,
automaticallyImplyLeading: false,
elevation: 0,
),
body: Observer(
builder: (context) => Column(
children: [
Expanded(
flex: 7,
child: Padding(
padding: context.paddingLow,
child: ListView.builder(
itemCount: viewModel.items.emails?.length ?? 0,
physics: const BouncingScrollPhysics(),
itemBuilder: (context, index) => Column(
children: [
Slidable(
actionPane: const SlidableDrawerActionPane(),
actions: [
IconSlideAction(
color: context.colorScheme.primaryVariant,
caption: 'Sil',
icon: Icons.delete,
onTap: () async {
Dio dio = Dio();
await dio.post(
"http://192.168.3.53/api/Email/email_move?id=${viewModel.items.emails?[index].id}&folder=trash&token=$token");
viewModel.fetchItems(token, "is_active");
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
backgroundColor:
context.colorScheme.secondaryVariant,
duration: context.durationSlow,
content: BodyText2Copy(
data: "Mail çöp kutusu klasörüne eklendi !",
color: context.colorScheme.onSurface,
),
),
);
},
),
IconSlideAction(
color: context.colorScheme.error,
foregroundColor: context.colorScheme.onSurface,
caption: 'Ertele',
icon: Icons.alarm,
onTap: () async {
Dio dio = Dio();
await dio.post(
"http://192.168.3.53/api/Email/email_move?id=${viewModel.items.emails?[index].id}&folder=snoozed&token=$token");
viewModel.fetchItems(token, "is_active");
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
backgroundColor:
context.colorScheme.secondaryVariant,
duration: context.durationSlow,
content: BodyText2Copy(
data:
"Mail ertelenenler klasörüne eklendi !",
color: context.colorScheme.onSurface,
),
),
);
},
),
IconSlideAction(
color: context.colorScheme.onPrimary,
foregroundColor: context.colorScheme.onSurface,
caption: 'Taslak',
icon: Icons.article_outlined,
onTap: () async {
debugPrint(token);
Dio dio = Dio();
await dio.post(
"http://192.168.3.53/api/Email/email_move?id=${viewModel.items.emails?[index].id}&folder=draft&token=$token");
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
backgroundColor:
context.colorScheme.secondaryVariant,
duration: context.durationSlow,
content: BodyText2Copy(
data: "Mail taslak klasörüne eklendi !",
color: context.colorScheme.onSurface,
),
),
);
},
),
],
secondaryActions: [
IconSlideAction(
color: context.colorScheme.error,
foregroundColor: context.colorScheme.onSurface,
caption: 'Spam',
icon: Icons.warning,
onTap: () async {
Dio dio = Dio();
await dio.post(
"http://192.168.3.53/api/Email/email_move?id=${viewModel.items.emails?[index].id}&folder=spam&token=$token");
viewModel.fetchItems(token, "is_active");
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
backgroundColor:
context.colorScheme.secondaryVariant,
duration: context.durationSlow,
content: BodyText2Copy(
data: "Mail spam klasörüne eklendi !",
color: context.colorScheme.onSurface,
),
),
);
},
),
IconSlideAction(
color: context.colorScheme.onError,
foregroundColor: context.colorScheme.onSurface,
caption: 'Önemli',
icon: Icons.label,
onTap: () async {
Dio dio = Dio();
await dio.post(
"http://192.168.3.53/api/Email/email_move?id=${viewModel.items.emails?[index].id}&folder=important&token=$token");
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
backgroundColor:
context.colorScheme.secondaryVariant,
duration: context.durationSlow,
content: BodyText2Copy(
data:
"Mail ertelenenler klasörüne eklendi !",
color: context.colorScheme.onSurface,
),
),
);
},
),
IconSlideAction(
color: context.colorScheme.surface,
foregroundColor: context.colorScheme.onSurface,
caption: 'Okundu',
icon: Icons.mark_email_read,
onTap: () async {
Dio dio = Dio();
await dio.post(
"http://192.168.3.53/api/Email/read_it?id=${viewModel.items.emails?[index].id}&folder=read&token=$token");
viewModel.fetchItems(token, "is_active");
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
backgroundColor:
context.colorScheme.secondaryVariant,
duration: context.durationSlow,
content: BodyText2Copy(
data: "Mail okundu olarak işaretlendi !",
color: context.colorScheme.onSurface,
),
),
);
},
),
IconSlideAction(
color: context.colorScheme.secondaryVariant,
foregroundColor: context.colorScheme.onSurface,
caption: 'Okunmadı',
icon: Icons.mark_email_unread,
onTap: () async {
Dio dio = Dio();
await dio.post(
"http://192.168.3.53/api/Email/read_it?id=${viewModel.items.emails?[index].id}&folder=unread&token=$token");
viewModel.fetchItems(token, "is_active");
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
backgroundColor:
context.colorScheme.secondaryVariant,
duration: context.durationSlow,
content: BodyText2Copy(
data: "Mail okunmadı olarak işaretlendi !",
color: context.colorScheme.onSurface,
),
),
);
},
),
],
child: Card(
shape: RoundedRectangleBorder(
borderRadius: context.lowBorderRadius),
elevation: 5,
child: ListTile(
leading: SizedBox(
width: context.dynamicWidth(0.21),
child: Row(
children: [
IconButton(
onPressed: () async {
Dio dio = Dio();
await dio.post(
"http://192.168.3.53/api/Email/email_move?id=${viewModel.items.emails?[index].id}&folder=starred&token=$token");
viewModel.fetchItems(token, "is_active");
ScaffoldMessenger.of(context)
.showSnackBar(
SnackBar(
backgroundColor: context
.colorScheme.secondaryVariant,
duration: context.durationSlow,
content: BodyText2Copy(
data:
"Mail yıldızlı klasörüne taşındı !",
color:
context.colorScheme.onSurface,
),
),
);
},
icon: const Icon(
Icons.star,
color: Colors.grey,
),
color: context.colorScheme.primaryVariant,
),
CircleAvatar(
backgroundImage: NetworkImage(viewModel
.items.emails?[index].user_photo ??
"http://192.168.3.53/assets/images/users/user0.jpg"),
)
],
),
),
title: Text(
viewModel.items.emails?[index].user_name ??
"Geçerli isim bulunamadı."),
subtitle: Subtitle1Copy(
data: viewModel.items.emails?[index].title ??
"Geçerli mail başlığı bulunamadı."),
trailing: Subtitle1Copy(
data: viewModel.items.emails?[index].date ??
"Geçerli tarih bulunamadı."),
onTap: () {
_showModalBottomSheet(
context,
radius,
viewModel,
index,
viewModel.items.emails?[index].user_id ?? "0",
token);
},
),
),
),
context.emptySizedHeightBoxLow,
],
),
),
),
),
context.emptySizedHeightBoxLow,
Padding(
padding: context.paddingNormal,
child: const Text(
"Mailleri silmek veya düzenlemek için sağa okundu veya okunmadı olarak işaretlemek için sola kaydırın.",
maxLines: 2,
),
),
Expanded(
child: Align(
alignment: Alignment.bottomRight,
child: Padding(
padding: context.paddingLow,
child: ElevatedButton(
onPressed: () {
Navigator.of(context).push(MaterialPageRoute(
builder: (context) => const SendMailView()));
},
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(
Icons.email,
color: context.colorScheme.onSurface,
),
context.emptySizedWidthBoxLow,
Text(
"Email Gönder",
style:
TextStyle(color: context.colorScheme.onSurface),
),
],
),
// style: ElevatedButton.styleFrom(
// primary: context.colorScheme.background,
// shape: RoundedRectangleBorder(
// borderRadius: context.lowBorderRadius),
//),
style: ButtonStyle(
foregroundColor: MaterialStateProperty.all<Color>(
context.colorScheme.background),
overlayColor: MaterialStateProperty.resolveWith<Color>(
(Set<MaterialState> states) {
if (states.contains(MaterialState.hovered)) {
return context.colorScheme.onBackground
.withOpacity(0.2);
}
if (states.contains(MaterialState.focused) ||
states.contains(MaterialState.pressed)) {
return context.colorScheme.onBackground
.withOpacity(0.2);
}
return Colors.red; // Defer to the widget's default.
},
),
backgroundColor: MaterialStateProperty.all<Color>(
context.colorScheme.background),
),
),
),
),
)
],
),
),
);
}
_showModalBottomSheet(context, double radius, MailViewModel viewModel,
int index, String id, String token) {
var titleController = TextEditingController();
var contentController = TextEditingController();
String htmlData = """
${viewModel.items.emails?[index].content}
""";
debugPrint(htmlData);
showModalBottomSheet(
isScrollControlled: true,
context: context,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(radius),
),
builder: (BuildContext context) {
return Observer(
builder: (_) => AnimatedContainer(
duration: context.durationNormal,
padding: context.paddingNormal,
height: viewModel.isContainerHeightChange
? context.dynamicHeight(0.5)
: context.dynamicHeight(0.95),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
context.emptySizedHeightBoxLow,
Center(
child: Container(
height: context.dynamicWidth(0.03),
width: context.dynamicWidth(0.2),
decoration: BoxDecoration(
borderRadius: context.lowBorderRadius,
color: Colors.grey),
),
),
context.emptySizedHeightBoxLow3x,
Divider(
color: Colors.grey,
indent: 20,
endIndent: 20,
),
Padding(
padding: context.paddingLow,
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
CircleAvatar(
backgroundImage: NetworkImage(
viewModel.items.emails?[index].user_photo ?? ""),
radius: 30,
),
context.emptySizedWidthBoxLow,
Expanded(
child: ListTile(
title: BodyText1Copy(
data: viewModel.items.emails?[index].user_name ??
"Geçerli kullanıcı adı bulunamadı."),
subtitle: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
BodyText2Copy(
data: "Kimden Geldi: ",
color: Colors.grey,
),
BodyText2Copy(
data: viewModel
.items.emails?[index].user_email ??
"Geçerli eposta adresi bulunamadı.",
color: Colors.grey),
context.emptySizedHeightBoxLow,
],
),
trailing: Text(viewModel.items.emails?[index].date ??
"Geçerli tarih bulunamadı."),
),
),
],
),
),
context.emptySizedHeightBoxLow,
SizedBox(
height: context.dynamicHeight(0.1),
child: SingleChildScrollView(
physics: const BouncingScrollPhysics(),
child: Padding(
padding: context.horizontalPaddingNormal,
child: Html(
data: htmlData,
),
),
),
),
context.emptySizedHeightBoxLow,
Divider(
color: Colors.grey,
indent: 20,
endIndent: 20,
),
viewModel.isContainerHeightChange
? context.emptySizedWidthBoxLow
: Expanded(
child: SingleChildScrollView(
physics: const BouncingScrollPhysics(),
child: SizedBox(
height: context.dynamicHeight(0.5),
child: Padding(
padding: context.paddingLow,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: context.paddingLow,
child: const Text("Başlık"),
),
context.emptySizedHeightBoxLow,
TextField(
controller: titleController,
decoration: InputDecoration(
prefixIcon: const Icon(Icons.title),
hintText:
'Epostanızın başlığını giriniz.',
labelText: 'Başlık',
enabledBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide:
BorderSide(color: Colors.grey),
),
focusedBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide: BorderSide(
color: context.colorScheme.surface),
),
),
cursorColor:
context.colorScheme.onSecondary,
),
context.emptySizedHeightBoxLow,
Padding(
padding: context.paddingLow,
child: const Text("İçerik"),
),
context.emptySizedHeightBoxLow,
TextField(
controller: contentController,
decoration: InputDecoration(
prefixIcon:
const Icon(Icons.content_paste),
hintText: "Eposta içeriğini giriniz.",
labelText: 'İçerik',
enabledBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide:
BorderSide(color: Colors.grey),
),
focusedBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide: BorderSide(
color: context.colorScheme.surface),
),
),
cursorColor:
context.colorScheme.onSecondary,
maxLines: 8,
),
],
),
),
),
),
),
Padding(
padding: context.horizontalPaddingLow,
child: Row(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.end,
children: [
viewModel.isContainerHeightChange
? context.emptySizedHeightBoxLow
: ElevatedButton(
onPressed: () async {
debugPrint("Id:" + id);
Dio dio = Dio();
await dio.post(
"http://192.168.3.53/api/Email/send_email?user_id=u$id&token=$token&title=${titleController.text}&content=${contentController.text}");
Navigator.of(context).pop();
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
backgroundColor:
context.colorScheme.secondaryVariant,
duration: context.durationSlow,
content: BodyText2Copy(
data: "Başarıyla çıkış yapıldı !",
color: context.colorScheme.onSurface,
),
),
);
},
child: BodyText2Copy(
data: "Gönder",
color: context.colorScheme.primaryVariant,
),
style: ElevatedButton.styleFrom(
primary: ColorSchemeLight.instance.pippin,
shape: RoundedRectangleBorder(
borderRadius: context.lowBorderRadius,
),
),
),
context.emptySizedWidthBoxLow3x,
ElevatedButton(
onPressed: () {
viewModel.changeContainerHeight();
},
child: BodyText2Copy(
data: "Yanıtla",
color: context.colorScheme.onPrimary,
),
style: ElevatedButton.styleFrom(
primary: ColorSchemeLight.instance.hummingBird,
shape: RoundedRectangleBorder(
borderRadius: context.lowBorderRadius,
),
),
),
context.emptySizedWidthBoxLow3x,
ElevatedButton(
onPressed: () {
Navigator.of(context).pop();
},
child: BodyText2Copy(
data: "Vazgeç",
color: context.colorScheme.background,
),
style: ElevatedButton.styleFrom(
primary: ColorSchemeLight.instance.amour,
shape: RoundedRectangleBorder(
borderRadius: context.lowBorderRadius,
),
),
),
],
),
),
],
),
),
);
},
);
}
}
| 0 |
mirrored_repositories/crm_app/lib/feature/home/mail/view/postponed | mirrored_repositories/crm_app/lib/feature/home/mail/view/postponed/view/postponed_view.dart | import 'package:flutter/material.dart';
import '../../../../../../core/constants/app/app_constants.dart';
import '../../../viewmodel/mail_view_model.dart';
import '../../mail_view.dart';
class PostponedView extends StatelessWidget {
final MailViewModel viewModel = MailViewModel();
PostponedView({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
viewModel.fetchItems(ApplicationConstants.instance!.token, "snoozed");
return MailView(
title: "Ertelenen Mailler",
viewModel: viewModel,
);
}
}
| 0 |
mirrored_repositories/crm_app/lib/feature/home/mail/view/spam | mirrored_repositories/crm_app/lib/feature/home/mail/view/spam/view/spam_view.dart | import '../../../../../../core/constants/app/app_constants.dart';
import 'package:flutter/material.dart';
import '../../../viewmodel/mail_view_model.dart';
import '../../mail_view.dart';
class SpamView extends StatelessWidget {
final MailViewModel viewModel = MailViewModel();
SpamView({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
viewModel.fetchItems(ApplicationConstants.instance!.token, "spam");
return MailView(
title: "Spam Mailler",
viewModel: viewModel,
);
}
}
| 0 |
mirrored_repositories/crm_app/lib/feature/home/mail/view/bin | mirrored_repositories/crm_app/lib/feature/home/mail/view/bin/view/bin_view.dart | import 'package:flutter/material.dart';
import '../../../../../../core/constants/app/app_constants.dart';
import '../../../viewmodel/mail_view_model.dart';
import '../../mail_view.dart';
class BinView extends StatelessWidget {
final MailViewModel viewModel = MailViewModel();
BinView({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
viewModel.fetchItems(ApplicationConstants.instance!.token, "trash");
return MailView(
title: "Çöp Kutusu",
viewModel: viewModel,
);
}
}
| 0 |
mirrored_repositories/crm_app/lib/feature/home/mail/view/inbox | mirrored_repositories/crm_app/lib/feature/home/mail/view/inbox/view/inbox_view.dart | import '../../../../../../core/constants/app/app_constants.dart';
import 'package:flutter/material.dart';
import '../../../viewmodel/mail_view_model.dart';
import '../../mail_view.dart';
class InboxView extends StatelessWidget {
final MailViewModel viewModel = MailViewModel();
InboxView({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
viewModel.fetchItems(ApplicationConstants.instance!.token, "is_active");
return MailView(
title: "Gelen Kutusu",
viewModel: viewModel,
);
}
}
| 0 |
mirrored_repositories/crm_app/lib/feature/home/mail/view/send_mail | mirrored_repositories/crm_app/lib/feature/home/mail/view/send_mail/view/send_mail_view.dart | // ignore_for_file: prefer_const_constructors
import 'package:crm_app/core/init/theme/light/color_scheme_light.dart';
import '../../../../../../core/components/text/body_text1_copy.dart';
import '../../../../../../core/components/text/body_text2_copy.dart';
import '../../../../../../core/constants/app/app_constants.dart';
import '../../../../../../product/widgets/card/check_box_card.dart';
import 'package:dio/dio.dart';
import '../../../../contact/viewmodel/contact_view_model.dart';
import 'package:flutter_mobx/flutter_mobx.dart';
import 'package:flutter/material.dart';
import 'package:kartal/kartal.dart';
class SendMailView extends StatefulWidget {
const SendMailView({Key? key}) : super(key: key);
@override
State<SendMailView> createState() => _SendMailViewState();
}
class _SendMailViewState extends State<SendMailView> {
final ContactViewModel _viewModel = ContactViewModel();
var titleController = TextEditingController();
var contentController = TextEditingController();
var nameController = TextEditingController();
var eMailController = TextEditingController();
@override
void initState() {
super.initState();
_viewModel.fetchItems(ApplicationConstants.instance!.token);
}
@override
Widget build(BuildContext context) {
return Observer(
builder: (context) {
return Scaffold(
appBar: AppBar(
title: Image.network(
"http://192.168.3.53/assets/images/logo-light.png",
width: context.dynamicWidth(0.28),
),
centerTitle: true,
),
body: SingleChildScrollView(
physics: const BouncingScrollPhysics(),
child: SizedBox(
height: context.dynamicHeight(1.6),
child: Column(
children: [
Expanded(
flex: 2,
child: Padding(
padding: context.paddingNormal,
child: Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(context.lowValue),
),
elevation: 5,
child: Padding(
padding: context.paddingNormal,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Center(
child: Padding(
padding: context.paddingLow,
child: const BodyText1Copy(data: "Kişilerim"),
),
),
context.emptySizedHeightBoxLow,
Expanded(
child: ListView.builder(
physics: const BouncingScrollPhysics(),
itemCount: _viewModel.lenght,
itemBuilder: (context, index) {
return Column(
children: [
index < _viewModel.items.users!.length
? CheckBoxCard(
isSelect: _viewModel.items
.users![index].isSelect,
data: _viewModel
.items
.users?[index]
.full_name ??
"",
userId: _viewModel.items
.users?[index].id ??
"0",
)
: const SizedBox(),
index < _viewModel.items.guides!.length
? CheckBoxCard(
isSelect: _viewModel.items
.guides![index].isSelect,
data: _viewModel.items
.guides?[index].name ??
"",
guiId: _viewModel.items
.guides?[index].id ??
"0",
)
: const SizedBox()
],
);
},
),
),
context.emptySizedHeightBoxLow,
],
),
),
),
),
),
Expanded(
flex: 2,
child: Padding(
padding: context.paddingNormal,
child: Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(context.lowValue),
),
elevation: 5,
child: Padding(
padding: context.paddingNormal,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Center(
child: Padding(
padding: context.paddingLow,
child: const BodyText1Copy(
data: "Kayıtlı olmayan eposta ekle"),
),
),
context.emptySizedHeightBoxLow3x,
TextField(
controller: nameController,
decoration: InputDecoration(
filled: true,
prefixIcon: const Icon(Icons.portrait),
hintText: 'Kişinin adı soyadını giriniz.',
labelText: 'Ad soyad',
enabledBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide: BorderSide(color: Colors.grey),
),
focusedBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide: BorderSide(
color: context.colorScheme.surface),
),
),
cursorColor: context.colorScheme.onSecondary,
),
context.emptySizedHeightBoxLow3x,
TextField(
controller: eMailController,
keyboardType: TextInputType.emailAddress,
decoration: InputDecoration(
filled: true,
prefixIcon: Icon(Icons.mail_outline_outlined),
hintText: 'Kişinin emailini giriniz.',
labelText: 'Email',
enabledBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide: BorderSide(color: Colors.grey),
),
focusedBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide: BorderSide(
color: context.colorScheme.surface),
),
),
cursorColor: context.colorScheme.onSecondary,
),
context.emptySizedHeightBoxLow,
Center(
child: SizedBox(
width: context.dynamicWidth(0.385),
child: ElevatedButton(
onPressed: () async {
Dio dio = Dio();
await dio.post(
"http://192.168.3.53/api/Persons/new_guide?token=${ApplicationConstants.instance!.token}&name=${nameController.text}&email=${eMailController.text}");
ScaffoldMessenger.of(context)
.showSnackBar(
SnackBar(
backgroundColor: context
.colorScheme.secondaryVariant,
duration: context.durationSlow,
content: BodyText2Copy(
data: "Kişi başarıyla eklendi !",
color:
context.colorScheme.onSurface,
),
),
);
setState(() {
_viewModel.fetchItems(
ApplicationConstants
.instance!.token);
});
},
child: Row(
children: [
Icon(
Icons.person_add,
color: ColorSchemeLight.instance.java,
),
context.emptySizedWidthBoxLow,
Text(
"Kişilerime Ekle",
style: TextStyle(
color: ColorSchemeLight
.instance.java),
),
],
),
style: ElevatedButton.styleFrom(
primary:
ColorSchemeLight.instance.hummingBird,
shadowColor:
ColorSchemeLight.instance.java,
),
),
),
),
],
),
),
),
),
),
Expanded(
flex: 3,
child: Padding(
padding: context.paddingNormal,
child: Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(context.lowValue),
),
elevation: 4,
child: Padding(
padding: context.paddingNormal,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
context.emptySizedHeightBoxLow,
Padding(
padding: context.paddingLow,
child: const Text("Başlık"),
),
context.emptySizedHeightBoxLow,
TextField(
controller: titleController,
decoration: InputDecoration(
filled: true,
hintText: 'Mailin başlığını giriniz.',
labelText: "Başlık",
prefixIcon: const Icon(Icons.title),
enabledBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide: BorderSide(color: Colors.grey),
),
focusedBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide: BorderSide(
color: context.colorScheme.surface),
),
),
cursorColor: context.colorScheme.onSecondary,
),
context.emptySizedHeightBoxLow3x,
Padding(
padding: context.paddingLow,
child: const Text("İçerik"),
),
TextField(
controller: contentController,
decoration: InputDecoration(
filled: true,
hintText: 'İçerik',
labelText: "Mail içeriğini giriniz.",
prefixIcon: const Icon(Icons.content_paste),
enabledBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide: BorderSide(color: Colors.grey),
),
focusedBorder: OutlineInputBorder(
borderRadius: context.lowBorderRadius,
borderSide: BorderSide(
color: context.colorScheme.surface),
),
),
cursorColor: context.colorScheme.onSecondary,
maxLines: 13,
),
context.emptySizedHeightBoxLow,
],
),
),
),
),
),
Align(
alignment: Alignment.bottomRight,
child: Padding(
padding: context.horizontalPaddingMedium,
child: SizedBox(
width: context.dynamicWidth(0.39),
child: ElevatedButton(
onPressed: () {
List<String> userId =
ApplicationConstants.instance!.userId;
List<String> guiId =
ApplicationConstants.instance!.guiId;
String token =
ApplicationConstants.instance!.token;
Dio dio = Dio();
if (userId.isNotEmpty && guiId.isEmpty) {
for (var i = 0; i < userId.length; i++) {
dio.post(
"http://192.168.3.53/api/Email/send_email?user_id=u${userId[i]}&token=$token&title=${titleController.text}&content=${contentController.text}");
}
} else if (userId.isEmpty && guiId.isNotEmpty) {
for (var i = 0; i < userId.length; i++) {
dio.post(
"http://192.168.3.53/api/Email/send_email?user_id=g${guiId[i]}&token=$token&title=${titleController.text}&content=${contentController.text}");
}
} else if (userId.isNotEmpty &&
guiId.isNotEmpty) {
for (var i = 0; i < userId.length; i++) {
dio.post(
"http://192.168.3.53/api/Email/send_email?user_id=g${guiId[i]}&token=$token&title=${titleController.text}&content=${contentController.text}");
}
for (var i = 0; i < userId.length; i++) {
dio.post(
"http://192.168.3.53/api/Email/send_email?user_id=u${userId[i]}&token=$token&title=${titleController.text}&content=${contentController.text}");
}
}
Navigator.of(context).pop();
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
backgroundColor:
context.colorScheme.secondaryVariant,
duration: context.durationSlow,
content: BodyText2Copy(
data: "Mail başarıyla gönderildi!",
color: context.colorScheme.onSurface,
),
),
);
},
child: Row(
children: [
Icon(
Icons.send,
color: context.colorScheme.surface,
),
context.emptySizedWidthBoxLow,
Text(
"Eposta Gönder",
style: TextStyle(
color: context.colorScheme.surface),
),
],
),
style: ButtonStyle(
overlayColor:
MaterialStateProperty.resolveWith<Color>(
(Set<MaterialState> states) {
if (states.contains(MaterialState.hovered)) {
return context.colorScheme.surface
.withOpacity(0.2);
}
if (states.contains(MaterialState.focused) ||
states.contains(MaterialState.pressed)) {
return context.colorScheme.surface
.withOpacity(0.2);
}
return Colors
.red; // Defer to the widget's default.
},
),
backgroundColor: MaterialStateProperty.all<Color>(
Color(0xffe8f4f8)),
)),
),
),
),
context.emptySizedHeightBoxLow,
],
),
),
),
);
},
);
}
}
| 0 |
mirrored_repositories/crm_app/lib/feature/home/mail/view/star | mirrored_repositories/crm_app/lib/feature/home/mail/view/star/view/star_view.dart | import 'package:flutter/material.dart';
import '../../../../../../core/constants/app/app_constants.dart';
import '../../../viewmodel/mail_view_model.dart';
import '../../mail_view.dart';
class StarView extends StatelessWidget {
final MailViewModel viewModel = MailViewModel();
StarView({
Key? key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
viewModel.fetchItems(ApplicationConstants.instance!.token, "starred");
return MailView(
title: "Yıldızlı Mailler",
viewModel: viewModel,
);
}
}
| 0 |
mirrored_repositories/crm_app/lib/feature/home/mail/view/tab | mirrored_repositories/crm_app/lib/feature/home/mail/view/tab/view/mail_tab_view.dart | // ignore_for_file: prefer_const_constructors
import 'package:crm_app/feature/home/bottomtab/model/bottomtab_model.dart';
import 'package:crm_app/feature/home/mail/view/inbox/view/inbox_view.dart';
import 'package:crm_app/feature/home/mail/view/postponed/view/postponed_view.dart';
import 'package:crm_app/feature/home/mail/view/star/view/star_view.dart';
import 'package:flutter/material.dart';
import 'package:kartal/kartal.dart';
import '../../bin/view/bin_view.dart';
import '../../draft/view/draft_view.dart';
import '../../important/view/important_view.dart';
import '../../incoming/view/incoming_view.dart';
import '../../spam/view/spam_view.dart';
class MailTabView extends StatelessWidget {
const MailTabView({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
final List<BottomTabModel> _items = [
BottomTabModel(
title: "Gelen Kutusu",
icon: Icons.inbox,
child: InboxView(),
),
BottomTabModel(
title: "Yıldızlı",
icon: Icons.star_border_outlined,
child: StarView(),
),
BottomTabModel(
title: "Ertelendi",
icon: Icons.schedule_outlined,
child: PostponedView(),
),
BottomTabModel(
title: "Taslak",
icon: Icons.article_outlined,
child: DraftView(),
),
BottomTabModel(
title: "Gönderilenler",
icon: Icons.send_outlined,
child: IncomingView(),
),
BottomTabModel(
title: "Çöp Kutusu",
icon: Icons.delete_forever_outlined,
child: BinView(),
),
BottomTabModel(
title: "Önemli",
icon: Icons.label,
child: ImportantView(),
),
BottomTabModel(
title: "Spam",
icon: Icons.warning,
child: SpamView(),
),
];
return DefaultTabController(
length: _items.length,
child: Scaffold(
bottomNavigationBar: BottomAppBar(
child: _buildTabBar(context, _items),
),
body: _buildTabBarView(_items),
),
);
}
TabBar _buildTabBar(BuildContext context, List<BottomTabModel> _items) =>
TabBar(
isScrollable: true,
unselectedLabelColor: context.colorScheme.primary,
labelColor: context.colorScheme.background,
indicatorColor: context.colorScheme.background,
tabs: _buildTabs(_items),
);
List<Widget> _buildTabs(List<BottomTabModel> _items) => List.generate(
_items.length,
(index) => Tab(
text: _items[index].title,
icon: Icon(_items[index].icon),
),
);
TabBarView _buildTabBarView(List<BottomTabModel> models) =>
TabBarView(children: models.map((e) => e.child).toList());
}
| 0 |
mirrored_repositories/crm_app/lib/feature/home/mail/view/incoming | mirrored_repositories/crm_app/lib/feature/home/mail/view/incoming/view/incoming_view.dart | import 'package:flutter/material.dart';
import '../../../../../../core/constants/app/app_constants.dart';
import '../../../viewmodel/mail_view_model.dart';
import '../../mail_view.dart';
class IncomingView extends StatelessWidget {
final MailViewModel viewModel = MailViewModel();
IncomingView({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
viewModel.fetchItems(ApplicationConstants.instance!.token, "");
return MailView(
title: "Gönderilen Mailler",
viewModel: viewModel,
);
}
}
| 0 |
mirrored_repositories/crm_app/lib/feature/home/mail/view/important | mirrored_repositories/crm_app/lib/feature/home/mail/view/important/view/important_view.dart | import '../../../../../../core/constants/app/app_constants.dart';
import 'package:flutter/material.dart';
import '../../../viewmodel/mail_view_model.dart';
import '../../mail_view.dart';
class ImportantView extends StatelessWidget {
final MailViewModel viewModel = MailViewModel();
ImportantView({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
viewModel.fetchItems(ApplicationConstants.instance!.token, "important");
return MailView(
title: "Önemli Mailler",
viewModel: viewModel,
);
}
}
| 0 |
mirrored_repositories/crm_app/lib/feature/home/mail/view/draft | mirrored_repositories/crm_app/lib/feature/home/mail/view/draft/view/draft_view.dart | import 'package:flutter/material.dart';
import '../../../../../../core/constants/app/app_constants.dart';
import '../../../viewmodel/mail_view_model.dart';
import '../../mail_view.dart';
class DraftView extends StatelessWidget {
final MailViewModel viewModel = MailViewModel();
DraftView({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
viewModel.fetchItems(ApplicationConstants.instance!.token, "draft");
return MailView(
title: "Taslak Mailler",
viewModel: viewModel,
);
}
}
| 0 |