Open berkeresvan opened 6 months ago
import 'package:flutter/material.dart';
class stepperkullanimi extends StatefulWidget { const stepperkullanimi({super.key});
@override State createState() => stepperkullanimiState(); }
class stepperkullanimiState extends State { int _aktifStep = 0; String isim = ""; String mail = ""; String sifre = ""; List tumstepler = []; var key0 = GlobalKey(); var key1 = GlobalKey(); var key2 = GlobalKey(); GlobalKey formKey1 = GlobalKey(); @override void initState() { // TODO: implement initState super.initState(); tumstepler = _tumstepler(); }
@override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text("Stepper Örnek"), ), body: SingleChildScrollView( child: Stepper( steps: _tumstepler(), currentStep: _aktifStep, onStepTapped: (tiklanilanStep) { setState(() { _aktifStep = tiklanilanStep; }); }, onStepContinue: () { setState(() { if (_aktifStep < tumstepler.length - 1) { _aktifStep++; } }); }, onStepCancel: () { setState(() { if (_aktifStep > 0) { _aktifStep--; } }); }, ), ), ); } }
List _tumstepler() { List stepler = [ Step( title: Text("Kullanıcı Adı Girinizzz"), subtitle: Text("Subtitle"), state: StepState.indexed, isActive: true, content: TextFormField( decoration: InputDecoration( labelText: "UserNameLabel", hintText: "UsernameHint", border: OutlineInputBorder()), validator: (girilendeger) { if (girilendeger!.length < 6) { return "en az 6 karakter giriniz"; } return null; }, onSaved: (girilendeger){
}, )), Step( title: Text("Mail Girinizzz"), subtitle: Text("Subtitle"), state: StepState.indexed, isActive: true, content: TextFormField( decoration: InputDecoration( labelText: "UserMailLabel", hintText: "UserMailHint", border: OutlineInputBorder()), validator: (girilendeger) { if (girilendeger!.length < 6 && girilendeger.contains("@")) { return "en az 6 karakter giriniz"; } return null; }, )), Step( title: Text("Şifre Girinizzz"), subtitle: Text("Subtitle"), state: StepState.indexed, isActive: true, content: TextFormField( decoration: InputDecoration( labelText: "ŞifreLabel", hintText: "ŞifreHint", border: OutlineInputBorder()), validator: (girilendeger) { if (girilendeger!.length < 6) { return "en az 6 karakter giriniz"; } return null; }, )),
]; return stepler; }
import 'package:flutter/material.dart';
class stepperkullanimi extends StatefulWidget { const stepperkullanimi({super.key});
@override State createState() => stepperkullanimiState();
}
class stepperkullanimiState extends State {
int _aktifStep = 0;
String isim = "";
String mail = "";
String sifre = "";
List tumstepler = [];
var key0 = GlobalKey();
var key1 = GlobalKey();
var key2 = GlobalKey();
GlobalKey formKey1 = GlobalKey();
@override
void initState() {
// TODO: implement initState
super.initState();
tumstepler = _tumstepler();
}
@override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text("Stepper Örnek"), ), body: SingleChildScrollView( child: Stepper( steps: _tumstepler(), currentStep: _aktifStep, onStepTapped: (tiklanilanStep) { setState(() { _aktifStep = tiklanilanStep; }); }, onStepContinue: () { setState(() { if (_aktifStep < tumstepler.length - 1) { _aktifStep++; } }); }, onStepCancel: () { setState(() { if (_aktifStep > 0) { _aktifStep--; } }); }, ), ), ); } }
List _tumstepler() {
List stepler = [
Step(
title: Text("Kullanıcı Adı Girinizzz"),
subtitle: Text("Subtitle"),
state: StepState.indexed,
isActive: true,
content: TextFormField(
decoration: InputDecoration(
labelText: "UserNameLabel",
hintText: "UsernameHint",
border: OutlineInputBorder()),
validator: (girilendeger) {
if (girilendeger!.length < 6) {
return "en az 6 karakter giriniz";
}
return null;
},
onSaved: (girilendeger){
]; return stepler; }