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:get/get_instance/src/extension_instance.dart'; | |
| import 'package:get/get_state_manager/get_state_manager.dart'; | |
| import 'package:get/state_manager.dart'; | |
| import 'package:visibility_detector/visibility_detector.dart'; | |
| class TestPage extends StatelessWidget { | |
| Controller controller = Get.put(Controller()); | |
| ScrollController scroolcontroller = ScrollController(); |
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 HomeStoreFragment : Fragment() { | |
| companion object { | |
| fun newInstances() : HomeStoreFragment = HomeStoreFragment() | |
| } | |
| private lateinit var binding : FragmentHomeStoreBinding | |
| //Give access to other class for gather viewpager references | |
| fun setVpEnable(isEnableVp: Boolean) { |
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 ExampleFragment : Fragment() { | |
| companion object { | |
| const val POSITION = "position" | |
| const val IS_NESTED = "is_nested" | |
| fun newInstances(position: Int, isNested: Boolean) : Fragment { | |
| return ExampleFragment().apply { | |
| arguments = Bundle().apply { | |
| putInt(POSITION, position) | |
| putBoolean(IS_NESTED, isNested) |
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
| //This is create access from nested level 2 into level 1 | |
| //if you have fragment in activity and this fragment have viewholder. fragment in viewholder access fragment in activity | |
| override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | |
| super.onViewCreated(view, savedInstanceState) | |
| val parentFrag = view.parent.parent as View | |
| Timber.e("is this fragment ${(parentFrag == null).toString()}") | |
| val toolbar = parentFrag.findViewById<Toolbar>(R.id.toolBar_main) | |
| Timber.e("id Toolbar is ${toolbar.id}") |
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
| buildscript { | |
| ext.kotlin_version = '1.2.31' | |
| repositories { | |
| mavenCentral() | |
| } | |
| dependencies { | |
| classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" | |
| } | |
| } |
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
| // Membuat fungsi decode file json yang memiliki kembalian berupa List Future | |
| Future<List<Flags>> loadContainerListBuilder () async { | |
| return await rootBundle.loadString('Assets/bendera.json') | |
| .then((String news) => json.decode(news) as List) | |
| .then((List value) { | |
| List<Flags> listFlags = []; | |
| value.forEach((index)=> listFlags.add(Flags.getJsonParser(index))); | |
| return listFlags; | |
| }); | |
| } |
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.example.shifu.speechrecognition; | |
| import android.content.BroadcastReceiver; | |
| import android.content.Context; | |
| import android.speech.tts.TextToSpeech; | |
| import android.support.v7.app.AppCompatActivity; | |
| import android.os.Bundle; | |
| import java.util.ArrayList; | |
| import java.util.List; |
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
| //Create slider with infinity scroll | |
| import 'dart:math'; | |
| import 'package:flutter/material.dart'; | |
| void main(){ | |
| runApp(new Myapp()); | |
| } | |
| class Myapp extends StatelessWidget { |
NewerOlder