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 'util/theme/theme_list_view.dart'; | |
class HomePage extends StatelessWidget { | |
const HomePage({Key key}) : super(key: key); | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( |
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
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"name": "Flutter Debug-Development", | |
"request": "launch", | |
"type": "dart", | |
"program": "lib/main_development.dart", | |
"args": [ | |
"--debug", |
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 <UIKit/UIKit.h> | |
NS_ASSUME_NONNULL_BEGIN | |
@interface UIColor (Ext) | |
// Original Colors | |
+ (UIColor *) primary; | |
// Compatible System Colors for iOS 12 and below |
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'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
debugShowCheckedModeBanner: false, | |
home: Scaffold( |
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
void main() { | |
final items = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k']; | |
final chunkedItems = []; | |
final chunkSize = 3; | |
var count = 0; | |
do { | |
chunkedItems.add(items.skip(count).take(chunkSize).toList()); | |
count += chunkSize; | |
} while (count < items.length); |
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
void main() { | |
final items = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k']; | |
final chunkedItems = []; | |
final chunkSize = 3; | |
for (var i = 0; i < items.length; i += chunkSize) { | |
final isLast = i + chunkSize >= items.length; | |
final end = isLast ? items.length : i + chunkSize; | |
chunkedItems.add(items.sublist(i, end)); | |
} |
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
enum Sport { | |
baseball, | |
football, | |
tennis, | |
swimming, | |
} | |
void main() { | |
final list = [Sport.baseball,Sport.football, Sport.tennis]; | |
final hasTennis = list.contains(Sport.tennis); |
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
/// Factory Constructorを使ったシングルトンクラスの定義方法 | |
class FactorySinglton { | |
/// 初めてインスタンス化するときにfactoryコンストラクタから使用する、Privateなコンストラクタ | |
FactorySinglton._() { | |
print('FactorySingleton Constructed'); | |
} | |
/// シングルトンを実現するインスタンスを提供 | |
factory FactorySinglton.instance() => _instance; |
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 Cat { | |
const Cat(this.name); | |
final String name; | |
} | |
void f<T>(T arg) { | |
if (arg is String) { | |
print('This is String!'); | |
} |
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'; | |
enum AppForm { | |
first, | |
second, | |
third, | |
} | |
extension AppFormExt on AppForm { | |