Skip to content

Instantly share code, notes, and snippets.

View codestronaut's full-sized avatar
🙌
Be Grateful

Aditya Rohman codestronaut

🙌
Be Grateful
View GitHub Profile
name: i_am_rich
description: A new Flutter project.
publish_to: "none"
version: 1.0.0+1
environment:
sdk: ">=2.7.0 <3.0.0"
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
const MyApp({Key key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
// The needed variable to be change
// state and image
int sceneState = 0;
String sceneImage = 'images/myroom_1st.png';
// this will be exceute on first time running the app
@override
void initState() {
changeState();
super.initState();
Container(
height: 36.0,
width: 36.0,
child: MaterialButton(
onPressed: () {
setState(() {
yellowScene();
changeState();
});
},
Image(
image: AssetImage(sceneImage),
),
@codestronaut
codestronaut / diskusi.ipynb
Last active October 17, 2020 07:45
Diskusi.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
/*
This program is used to find protein in a strand of DNA
*/
public class DNA {
public static void main(String[] args) {
// -. .-. .-. .-. .
// \ \ / \ \ /
import 'package:dartz/dartz.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:flutter_weather_app_sample/domain/entities/weather.dart';
import 'package:flutter_weather_app_sample/domain/usecases/get_current_weather.dart';
import 'package:mockito/mockito.dart';
import '../../helpers/test_helper.mocks.dart';
void main() {
late MockWeatherRepository mockWeatherRepository;
import 'package:equatable/equatable.dart';
class Weather extends Equatable {
const Weather({
required this.cityName,
required this.main,
required this.description,
required this.iconCode,
required this.temperature,
required this.pressure,
import 'package:dartz/dartz.dart';
import 'package:flutter_weather_app_sample/data/failure.dart';
import 'package:flutter_weather_app_sample/domain/entities/weather.dart';
abstract class WeatherRepository {
Future<Either<Failure, Weather>> getCurrentWeather(String cityName);
}