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:file_picker/file_picker.dart'; import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; import 'package:isar/isar.dart'; class SayfaUyeBirikimHesapEkle extends StatelessWidget { SayfaUyeBirikimHesapEkle({super.key}); FinansServis? finansServis; @override StatelessElement createElement() { // TODO: implement createElement finansServis = FikoYTCoreService.servisler.getServis(); return super.createElement(); } @override Widget build(BuildContext context) { SchedulerBinding.instance.addPostFrameCallback((_) { finansServis?.altBaslik.value = "Yeni Birikim Hesabı"; }); return FikoYTSliverApp( leading: const UygulamaBaslikSol(), title: UygulamaBaslikOrta(), actions: const [UygulamaBaslikSag()], drawer: finansServis?.solMenu.value, backgroundColor: Theme.of(context).extension()?.arkaPlanRengi, appBarColor: Theme.of(context).extension()?.appBarColor?.withAlpha(230), headerExpandedHeight: 230, // stretchMaxHeight: 100, fullyStretchable: true, centerTitle: true, alwaysShowLeadingAndAction: true, alwaysShowTitle: true, curvedBodyRadius: 0, onStretchTrigger: () async { context.vRouter.to("/"); }, /// headerWidget: // Stack( // children: [ // Positioned( // bottom: 0, // left: 0, // right: 0, // // top: kToolbarHeight, // child: Column( // crossAxisAlignment: CrossAxisAlignment.center, // children: [ // FikoytOvalResim( // resimUrl: // FikoYTCoreService.servisler.getServis()?.aktifKullanici.value?.profilePictureUrl ?? "🏠", // tema: FikoYTOvalResimTheme(borderColor: Colors.amber, radius: 15, spacing: 3), // ), // FikoYTButton(text: FikoYTCoreService.servisler.getServis()?.aktifKullanici.value?.name), // ], // ), // ), Column( children: [ const SizedBox(height: kToolbarHeight), Obx( () => FikoytOvalResim( resimUrl: finansServis?.aktifKullanici.value?.profilResmiUrl ?? "🎟️", tema: FikoYTOvalResimTheme(borderColor: Colors.blue, radius: 48), 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 finansServis?.aktifKullanici.value?.profilResmiUrl = storeImage.absolute.path; Isar? isar = finansServis?.isar; isar?.writeTxn(() async { isar.kullanicis.put(finansServis!.aktifKullanici.value!); }); finansServis?.aktifKullanici.refresh(); } else { // profilResmi.value = null; } }, ), ), FikoYTButton( text: finansServis?.aktifKullanici.value?.ismi ?? "Yeni Birikim Hesabı", tema: FikoYTButtonTheme(textColor: Colors.black, fontWeight: FontWeight.w700, fontSize: 18), ), FikoYTButton( text: "Sisteminizde Yeni Bir Birikim Hesabı Ekleyin.", tema: FikoYTButtonTheme( textColor: Colors.black38, fontWeight: FontWeight.normal, fontSize: 12, textAlign: TextAlign.center, ), ), ], ), // ], // ), /// body: [ Row( mainAxisAlignment: MainAxisAlignment.center, children: [ const Expanded(child: Divider(indent: 0.0, endIndent: 10.0, thickness: 1)), FikoYTButton( text: '🎟️ Yeni Birikim Hesabı', 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)), ], ), /** */ // SizedBox(height: 1400), // Text("sffffffffffffff"), ], ); } }