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 engineer = Engineer(); | |
| engineer..engineer() | |
| ..physics() | |
| ..english(); | |
| final lawyer = Lawyer(); | |
| lawyer..law() | |
| ..english() |
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 com.squareup.inject.assisted.dagger2.AssistedModule | |
| import dagger.Module | |
| @AssistedModule | |
| @Module(includes = [AssistedInject_AssistedInjectModule::class]) | |
| class AssistedInjectModule |
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
| // AssistedInject and Hilt working together in v2.28-alpha times | |
| // Example of a ViewModel using AssistedInject injected in a Fragment by Hilt | |
| // As AssistedInject isn't part of Dagger yet, we cannot use in | |
| // conjuction with @ViewModelInject | |
| data class MyInitParams(private val neededId: String) | |
| class MyViewModel @AssistedInject constructor( | |
| ... // Other dependencies injected by Hilt | |
| // com.squareup.inject.assisted.Assisted annotation |
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
| package com.tomek | |
| abstract class Animal(val size: Int) | |
| class Dog(val cuteness: Int): Animal(100) | |
| class Spider(val terrorFactor: Int): Animal(1) | |
| // Covariance |
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() { | |
| int n = 4; | |
| int besideSq = 2 * beside(n); | |
| int middleSq = middle(n); | |
| int totalSquares = besideSq + middleSq; | |
| print(totalSquares); | |
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(const MyApp()); | |
| } | |
| class MyApp extends StatelessWidget { | |
| const MyApp({super.key}); | |
| @override |
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 'package:inherited_widget_tuto/counter.dart'; | |
| import 'package:inherited_widget_tuto/home.dart'; | |
| void main() { | |
| runApp(const MyApp()); | |
| } | |
| class MyApp extends StatefulWidget { | |
| const MyApp({super.key}); |
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:developer'; | |
| import 'package:flutter/material.dart'; | |
| //asset file network memory | |
| void main(){ | |
| runApp( | |
| const MaterialApp( | |
| debugShowCheckedModeBanner: false, | |
| home : Home() |
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
| //debug release profile | |
| //assets file binary network | |
| //container | |
| // Material , Cupertino | |
| //Stateless .Stateful | |
| import 'dart:developer'; | |
| import 'package:flutter/material.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
| import 'package:flutter/material.dart'; | |
| //Google => Material | |
| //Iphone => Cupertino | |
| //Widget => less ,ful | |
| //debug //release // hybrid | |
| //Container | |
| //project file network memory | |
| void main() { | |
| runApp(const MaterialApp( |
OlderNewer