This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String[] sehirler ={"Adana","Adıyaman", "Afyon", "Ağrı", "Amasya", "Ankara", "Antalya", "Artvin", | |
"Aydın", "Balıkesir","Bilecik", "Bingöl", "Bitlis", "Bolu", "Burdur", "Bursa", "Çanakkale", | |
"Çankırı", "Çorum","Denizli","Diyarbakır", "Edirne", "Elazığ", "Erzincan", "Erzurum ", "Eskişehir", | |
"Gaziantep", "Giresun","Gümüşhane", "Hakkari", "Hatay", "Isparta", "Mersin", "İstanbul", "İzmir", | |
"Kars", "Kastamonu", "Kayseri","Kırklareli", "Kırşehir", "Kocaeli", "Konya", "Kütahya ", "Malatya", | |
"Manisa", "Kahramanmaraş", "Mardin", "Muğla", "Muş", "Nevşehir", "Niğde", "Ordu", "Rize", "Sakarya", | |
"Samsun", "Siirt", "Sinop", "Sivas", "Tekirdağ", "Tokat", "Trabzon ", "Tunceli", "Şanlıurfa", "Uşak", | |
"Van", "Yozgat", "Zonguldak", "Aksaray", "Bayburt ", "Karaman", "Kırıkkale", "Batman", "Şırnak", | |
"Bartın", "Ardahan", "Iğdır", "Yalova", "Karabük ", "Kilis", "Osmaniye ", "Düzce"}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import './hardwareandro.dart'; | |
void main() { | |
var val1 = "string1"; | |
String val2 = "string2,asdasd"; | |
int _int1 = 15; | |
var int1 = 5; | |
bool _bool = true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class HardwareAndro { | |
String videoTitle; | |
var author; | |
int number; | |
int _channel; | |
var _data; | |
/** | |
* Encapsulation | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class LoginView extends StatefulWidget { | |
@override | |
_LoginViewState createState() => _LoginViewState(); | |
} | |
class _LoginViewState extends State<LoginView> { | |
@override | |
Widget build(BuildContext context) { | |
return BaseView<LoginModel>( | |
onModelReady: (model) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class LoginModel extends BaseModel { | |
Api _api = locator<Api>(); | |
TextEditingController userEmail; | |
TextEditingController userPassword; | |
BuildContext _context; | |
LoginModel() { | |
userEmail = new TextEditingController(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BaseView<T extends BaseModel> extends StatefulWidget { | |
//init builder model context and child delegate | |
final Widget Function(BuildContext context, T model, Widget child) builder; | |
//init onModelReaedy start on model life cycle | |
final Function(T) onModelReady; | |
BaseView({@required this.builder, this.onModelReady}); | |
@override | |
_BaseViewState createState() => _BaseViewState<T>(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Consumer olarak ürettiğimiz sayfalarda değişiklikleri ilgili yerlere haber vermek | |
//için kullanılır | |
abstract class BaseModel extends ChangeNotifier { | |
void setContext(BuildContext context); | |
//Default state ataması her sayfada gelen ve ilk iş yapılmayan anı bize söyler | |
ViewState _state = ViewState.Idle; | |
//sayfalardaki state durumu kontrolü | |
ViewState get state => _state; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GetIt locator = GetIt(); | |
void setupLocator() { | |
locator.registerSingleton(Api()); | |
locator.registerSingleton(FeedApi()); | |
locator.registerFactory(() => LoginModel()); | |
locator.registerFactory(() => FeedModel()); | |
locator.registerFactory(() => SplashModel()); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// The service responsible for networking requests | |
class Api { | |
final _client = new http.Client(); | |
Future signin_user(LoginRequest login) { | |
Completer _completer = new Completer(); | |
_client | |
.post( | |
'${ApiHelper.AUTH_END_POINT}/verifyPassword?key=${ApiHelper.API_KEY}', | |
body: login.toJson()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:json_annotation/json_annotation.dart'; | |
part 'login_response.g.dart'; | |
@JsonSerializable() | |
class LoginResponse { | |
String kind; | |
String localId; | |
String email; | |
String id_token; |
OlderNewer