import 'dart:io'; import 'package:fikoyt_akcali_v1/apps/finans/core/models/finans.model.dart'; import 'package:fikoyt_akcali_v1/apps/finans/core/services/finans.servis.dart'; import 'package:fikoyt_akcali_v1/core/widgets/uygulama_baslik/uygulama_baslik.dart'; import 'package:fikoyt_ui/fikoyt_ui.dart'; import 'package:fikoyt_ui/ui/fikoyt_card.dart'; import 'package:fikoyt_ui/ui/yazi_kutulari/yazi_kutulari.dart'; import 'package:file_picker/file_picker.dart'; import 'package:flutter/material.dart'; class SayfaKisiIlkKurulum extends StatelessWidget { SayfaKisiIlkKurulum({super.key}); Rx kayit = User().obs; @override Widget build(BuildContext context) { FikoYTCoreService.servisler.getServis()?.altBaslik.value = "İlk Kurulum"; return FikoYTSliverApp( leading: const UygulamaBaslikSol(), title: UygulamaBaslikOrta(), actions: const [UygulamaBaslikSag()], backgroundColor: Theme.of(context).extension()?.backgroundColor, appBarColor: Theme.of(context).extension()?.appBarColor?.withAlpha(230), bodyColor: Colors.grey.shade300, headerExpandedHeight: 250, // stretchMaxHeight: 100, fullyStretchable: true, centerTitle: true, alwaysShowLeadingAndAction: true, alwaysShowTitle: true, curvedBodyRadius: 0, onStretchTrigger: () async { context.vRouter.to("/"); }, headerWidget: Column( children: [ const SizedBox(height: kToolbarHeight), FikoytOvalResim( resimUrl: "packages/fikoyt_ui/assets/fitness_app/lunch.png", tema: FikoYTOvalResimTheme(borderColor: Colors.blue), ), FikoYTButton( text: "İlk Kurulum", tema: FikoYTButtonTheme(textColor: Colors.black, fontWeight: FontWeight.w700, fontSize: 18), ), FikoYTButton( text: "Sistem kurulumunu yapmak için bilgileri doldurunuz. Yönlendirmelere göre sisteminizi ayarlayınız.", tema: FikoYTButtonTheme( textColor: Colors.black38, fontWeight: FontWeight.normal, fontSize: 12, textAlign: TextAlign.center, ), ), ], ), sliverAltKisimGoster: false, sliverAltKisim: null, body: [ SizedBox(height: 10), Row( mainAxisAlignment: MainAxisAlignment.center, children: [ const Expanded(child: Divider(indent: 0.0, endIndent: 10.0, thickness: 1)), FikoYTButton( text: '👔 Yönetici Hesabı Tanımlama', tema: Theme.of(context).extension()?.copyWith( textStrokeColor: Colors.transparent, textColor: Theme.of(context).extension()?.textColor, ), ), const Expanded(child: Divider(indent: 10.0, endIndent: 0.0, thickness: 1)), ], ), FikoYTCard( children: [ Row( crossAxisAlignment: CrossAxisAlignment.start, spacing: 5, children: [ Column( children: [ Obx( () => FikoytOvalResim( resimUrl: kayit.value.profilePictureUrl ?? "🎓", tema: FikoYTOvalResimTheme(borderColor: Colors.blue, radius: 36,spacing: 7), ), ), SizedBox(height: 5), Obx( () => AnimatedCrossFade( firstChild: FikoYTButton( key: ValueKey("Resim Seç Button"), text: "Resim Seç", tema: FikoYTButtonTheme( textColor: Colors.white, backgroundColor: Colors.blue, // fontWeight: FontWeight.w700, edgePadding: EdgeInsets.all(3), borderColor: Colors.blueAccent, elevation: 3, fontSize: 10, ), onPressed: () async { FilePickerResult? result = await FilePicker.platform.pickFiles( allowMultiple: false, type: FileType.image, lockParentWindow: true, ); if (result != null) { File storeImage = File(result.files.first.path!); // use getApplicationDocumentsDirectory() to get a directory inside the app kayit.value.profilePictureUrl = storeImage.absolute.path; kayit.refresh(); } else { // profilResmi.value = null; } }, ), secondChild: FikoYTButton( key: ValueKey("Resim Sil Button"), text: "Resim Sil", tema: FikoYTButtonTheme( textColor: Colors.white, backgroundColor: Colors.red, // fontWeight: FontWeight.w700, edgePadding: EdgeInsets.all(3), borderColor: Colors.redAccent, elevation: 3, fontSize: 10, ), onPressed: () async { kayit.value.profilePictureUrl = null; kayit.refresh(); }, ), crossFadeState: kayit.value.profilePictureUrl != null ? CrossFadeState.showSecond : CrossFadeState.showFirst, duration: 1000.ms, ), ), ], ), Expanded( child: Column( spacing: 5, children: [ FikoYaziKutusu( baslik: "Kullanıcı Adı", simgeSol: const Text("👩🏻‍🤝‍👨🏽", style: TextStyle(fontSize: 14)), yaziBoyutu: 12.0, radius: 5.0, degeri: kayit.value.name, degisti: (value) { kayit.value.name = value; }, oneriOtomatikDoldurma: [AutofillHints.username], ), FikoYaziKutusu( baslik: "E-Posta", simgeSol: const Text("📧", style: TextStyle(fontSize: 14)), yaziBoyutu: 12.0, radius: 5.0, degeri: kayit.value.email, degisti: (value) { kayit.value.email = value; }, oneriOtomatikDoldurma: [AutofillHints.email], ), FikoYaziKutusu( baslik: "Parola", simgeSol: const Text("🔐", style: TextStyle(fontSize: 14)), gizli: true, yaziBoyutu: 12.0, radius: 5.0, degeri: kayit.value.password, degisti: (value) { kayit.value.password = value; }, oneriOtomatikDoldurma: [AutofillHints.email], ), /// Obx( () => Row( mainAxisAlignment: MainAxisAlignment.end, children: [ FikoYTButton( text: "👨‍👨‍👦‍👦 Şirket", tema: Theme.of(context).extension()?.copyWith( backgroundColor: kayit.value.userType == "Şirket" ? Colors.blue : Colors.transparent, textColor: kayit.value.userType == "Şirket" ? Colors.white : Colors.black, edgePadding: const EdgeInsets.only(right: 1, left: 4, top: 2, bottom: 2), borderRadius: BorderRadius.only( topLeft: Radius.circular(5), bottomLeft: Radius.circular(5), bottomRight: Radius.zero, topRight: Radius.zero, ), // radius: 0, fontSize: 10, borderColor: Colors.lightBlueAccent, ), onPressed: () { kayit.value.userType = "Şirket"; kayit.refresh(); }, ), FikoYTButton( text: "💼 Tüzel", tema: Theme.of(context).extension()?.copyWith( backgroundColor: kayit.value.userType == "Tüzel" ? Colors.blue : Colors.transparent, textColor: kayit.value.userType == "Tüzel" ? Colors.white : Colors.black, edgePadding: const EdgeInsets.only(right: 4, left: 1, top: 2, bottom: 2), borderRadius: BorderRadius.only( topLeft: Radius.circular(5), bottomLeft: Radius.circular(5), bottomRight: Radius.zero, topRight: Radius.zero, ), // radius: 0, fontSize: 10, borderColor: Colors.lightBlueAccent, ), onPressed: () { kayit.value.userType = "Tüzel"; kayit.refresh(); }, ), ], ), ), SizedBox(height: 5), Row( children: [ Spacer(), FikoYTButton( text: "✨ Oluştur", tema: FikoYTButtonTheme( textColor: Colors.white, backgroundColor: Colors.blue, // fontWeight: FontWeight.w700, edgePadding: EdgeInsets.all(3), borderColor: Colors.blueAccent, elevation: 3, fontSize: 12, ), onPressed: () { print(kayit.value.name); }, ), ], ), ], ), ), ], ), ], ), SizedBox(height: 5), Padding( padding: const EdgeInsets.all(8.0), child: FikoYTAlert( description: "Bu Oluşturacağınız Hesap Sisteminizin Yönetici Hesabı Olacak Tüm Yetkilere Sahip Olacak Bu Yüzden Parolayı Kesinlikle Unutmayınız.Bilgileriniz Bizimle Paylaşılmaz Tüm Bilgileriniz Cihazınızda Kayıtlı Kalır.", emoji: "🚨", ), ), // FikoYaziKutusu( // baslik: "Kullanıcı Adı", // simgeSol: const Text("👩🏻‍🤝‍👨🏽", style: TextStyle(fontSize: 16)), // yaziBoyutu: 12.0, // radius: 5.0, // degeri: kayit.value.name, // degisti: (value) { // kayit.value.name = value; // }, // oneriOtomatikDoldurma: [AutofillHints.username], // ), // SizedBox(height: 5), // FikoYaziKutusu( // baslik: "E-Posta", // simgeSol: const Text("📧", style: TextStyle(fontSize: 16)), // yaziBoyutu: 12.0, // radius: 5.0, // degeri: kayit.value.email, // degisti: (value) { // kayit.value.email = value; // }, // oneriOtomatikDoldurma: [AutofillHints.email], // ), // SizedBox(height: 5), // FikoYaziKutusu( // baslik: "Parola", // simgeSol: const Text("🔐", style: TextStyle(fontSize: 16)), // gizli: true, // yaziBoyutu: 12.0, // radius: 5.0, // degeri: kayit.value.password, // degisti: (value) { // kayit.value.password = value; // }, // oneriOtomatikDoldurma: [AutofillHints.email], // ), // SizedBox(height: 5), // SizedBox(height: 100), // Text("sffffffffffffff"), ], ); } }