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
{ | |
"dart.lineLength": 80, | |
"docwriter.hotkey.mac": "⌥ + .", | |
"editor.formatOnSave": true, | |
"editor.formatOnPaste": true, | |
"editor.fontFamily": "JetBrains Mono", | |
"explorer.fileNesting.patterns": { | |
"pubspec.yaml": ".flutter-plugins, .packages, .dart_tool, .flutter-plugins-dependencies, .metadata, .packages, pubspec.lock, build.yaml, analysis_options.yaml, all_lint_rules.yaml", | |
".gitignore": ".gitattributes, .gitmodules, .gitmessage, .mailmap, .git-blame*", | |
"readme.*": "authors, backers.md, changelog*, citation*, code_of_conduct.md, codeowners, contributing.md, contributors, copying, credits, governance.md, history.md, license*, maintainers, readme*, security.md, sponsors.md", |
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:http/http.dart' as http; | |
import 'dart:convert'; | |
void main() { | |
addProduct(Product(description: 'vb10', | |
id: '123', | |
imageUrl: 'vb.png', | |
isFavorite: true, | |
price: '1200', | |
title: 'Solution' |
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 BaseFirebaseModel<T> { | |
final String id; | |
final T? data; | |
BaseFirebaseModel({ | |
required this.id, | |
required this.data, | |
}); | |
} |
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
name: vb10 | |
description: A new Flutter project. | |
publish_to: "none" # Remove this line if you wish to publish to pub.dev | |
version: 1.0.0+1 | |
environment: | |
sdk: ">=2.15.0 <3.0.0" | |
dependencies: |
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 User { | |
final String firstName; | |
User(this.firstName); | |
static List<User> dummyUsers() { | |
return [ | |
User('veli'), | |
User('bora'), | |
]; |
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
{ | |
Future<void> controlUser(String email, String password) async { | |
if (!_changeValidateModel()) return; | |
_changeLoading(); | |
final response = await loginService.controlUser(model: LoginRequestModel(email: email, password: password)); | |
_changeLoading(); | |
await keepLocalUserResponse(response); | |
_navigatePage(response); | |
} |
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
Scaffold( | |
appBar: AppBar(backgroundColor: Colors.transparent, elevation: 0, systemOverlayStyle: SystemUiOverlayStyle.dark), | |
body: Padding( | |
padding: context.paddingMedium, | |
child: Form( | |
key: formValidateKey, | |
autovalidateMode: isAutoValidate ? AutovalidateMode.always : AutovalidateMode.disabled, | |
child: Column( | |
crossAxisAlignment: CrossAxisAlignment.start, | |
children: [ |
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 UserView2 extends StatelessWidget { | |
const UserView2({Key? key}) : super(key: key); | |
@override | |
Widget build(BuildContext context) { | |
return BlocProvider<UserCubit2>( | |
create: (context) => UserCubit2(context, userService: FirebaseUserSerivice()), | |
child: BlocConsumer<UserCubit2, UserState2>( | |
listener: (context, state) { | |
if (state.response != null) { |
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 'dart:async'; | |
import 'package:flutter/material.dart'; | |
import 'package:lottie/lottie.dart'; | |
class NotiferChanges<T> { | |
final StreamController<T> _fetchDoneController = StreamController.broadcast(); | |
changeNavigate(T data) { | |
_fetchDoneController.add(data); // send an arbitrary event |
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 SearchField extends StatefulWidget { | |
final void Function(String value) onChanged; | |
const SearchField({Key? key, required this.onChanged}) : super(key: key); | |
@override | |
_SearchFieldState createState() => _SearchFieldState(); | |
} | |
class _SearchFieldState extends State<SearchField> { | |
late CancelableOperation<void> cancellableOperation; |