This file contains hidden or 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
| if [ $1 == "bundle"] | |
| then | |
| flutter build appbundle --build-name=$1 --build-number=$2 | |
| else | |
| flutter build apk --build-name=$1 --build-number=$2 | |
| fi | |
| open build/app/outputs/flutter-apk |
This file contains hidden or 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
| extension FutureExtension on Future { | |
| Widget toBuild<T>({Widget Function(T data) onSuccess, Widget onError, dynamic data}) { | |
| return FutureBuilder<T>( | |
| future: this, | |
| initialData: data, | |
| builder: (BuildContext context, AsyncSnapshot snapshot) { | |
| switch (snapshot.connectionState) { | |
| case ConnectionState.waiting: | |
| case ConnectionState.active: | |
| return Center(child: CircularProgressIndicator()); |
This file contains hidden or 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 main() async { | |
| WidgetsFlutterBinding.ensureInitialized(); | |
| await firebaseInit(); | |
| runApp(Home()); | |
| } | |
| Future<void> firebaseInit() async { | |
| if (Platform.isIOS) await firebaseMessaging.requestNotificationPermissions(); | |
| await firebaseMessaging.subscribeToTopic(AppConstant.FIREBASE_TOPICS_ALL); | |
| } |
This file contains hidden or 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:convert'; | |
| import 'dart:io'; | |
| main() { | |
| print('1 + 1 = ...'); | |
| var line = stdin.readLineSync(encoding: Encoding.getByName('utf-8')); | |
| print(line.trim() == '2' ? 'Yup!' : 'Nope :('); | |
| } |
This file contains hidden or 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
| { | |
| "Magic number": { | |
| "scope": "dart", | |
| "prefix": "hwaMagicNumber", | |
| "body": "static const $1 = $2;", | |
| "description": "Hwa Magic Number Create" | |
| }, | |
| "SIngleton Eager": { | |
| "scope": "dart", |
This file contains hidden or 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 ApplicationConstants { | |
| static const LANG_ASSET_PATH = "asset/lang"; | |
| static const IPAD_NAME = "IPAD"; | |
| } |
This file contains hidden or 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
| { | |
| "Magic number": { | |
| "scope": "dart", | |
| "prefix": "hwaMagicNumber", | |
| "body": "static const $1 = $2;", | |
| "description": "Hwa Magic Number Create" | |
| }, | |
| "Singleton Eager": { | |
| "scope": "dart", | |
| "prefix": "hwaEager", |
This file contains hidden or 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:flutter/material.dart'; | |
| main(List<String> args) { | |
| runApp(MaterialApp( | |
| home: new Scaffold( | |
| appBar: AppBar( | |
| title: Text("Flutter Dersleri"), | |
| ), | |
| floatingActionButton: FloatingActionButton( | |
| onPressed: () {}, |
This file contains hidden or 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
| abstract class BaseModel<T> { | |
| Map<String, Object> toJson(); | |
| T fromJson(Map<String, Object> json); | |
| } |
This file contains hidden or 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:flutter/material.dart'; | |
| import 'custom_card.dart'; | |
| class SwitchView extends StatefulWidget { | |
| @override | |
| _SwitchViewState createState() => _SwitchViewState(); | |
| } | |
| class _SwitchViewState extends State<SwitchView> { |