Skip to content

Instantly share code, notes, and snippets.

View isaacadariku's full-sized avatar
👨‍💻
Focusing

Eternity (Isaac Adariku) isaacadariku

👨‍💻
Focusing
View GitHub Profile
@isaacadariku
isaacadariku / cardbeva.dart
Created November 3, 2020 09:02
A sample card
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
debugShowCheckedModeBanner: false,
@isaacadariku
isaacadariku / books.json
Created March 18, 2021 20:27
A simple book json for a Flutter example app
[
{
"id":1,
"title":"Modern Buildings",
"author":"Ardi Evans",
"urlImage":"https://images.unsplash.com/photo-1615347497551-277d6616b959?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=692&q=80"
},
{
"id":2,
"title":"Busy City Life",
@isaacadariku
isaacadariku / books.json
Created March 18, 2021 20:27
A simple book json for a Flutter example app
[
{
"id":1,
"title":"Modern Buildings",
"author":"Ardi Evans",
"urlImage":"https://images.unsplash.com/photo-1615347497551-277d6616b959?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=692&q=80"
},
{
"id":2,
"title":"Busy City Life",
@isaacadariku
isaacadariku / main.dart
Last active October 7, 2022 15:58
This gist is a solution to the comment Image below.
import 'dart:math' as math;
void main() {
final Circle c1 = Circle.all(color: 'blue', radius: 2.0);
c1.getRadius();
c1.getColor();
c1.getArea();
final Circle c2 = Circle.radius(radius: 2.0);
c2.getRadius();
@isaacadariku
isaacadariku / main.dart
Created July 14, 2021 00:43
A gist to separate list into chucks of list
void main() {
// Generate List of numbers
List numbers = List<int>.generate(20, (index) => index);
int length = numbers.length;
int split = 2;
List chunks = [];
for (int i = 0; i < length; i += split) {
var end = (i + split < length) ? i + split : length;
@isaacadariku
isaacadariku / main.dart
Last active January 24, 2022 23:15
A checked container that checked when tap
import 'package:flutter/material.dart';
void main() {
runApp(Amenties());
}
class CheckContainer extends StatefulWidget {
const CheckContainer({Key? key, this.title = ''}) : super(key: key);
final String title;
@isaacadariku
isaacadariku / main.dart
Created January 24, 2022 23:36
A check container with populated list
import 'package:flutter/material.dart';
void main() {
runApp(Amenities());
}
class CheckContainerModel {
final String title;
bool isCheck;
@isaacadariku
isaacadariku / main.dart
Last active February 1, 2022 10:46
Dynamic programming for fibonacci
void main() {
int i = 150;
final fib = fibonacciWithDynamicProgramming();
print('fibonacciWithDynamicProgramming($i) = ${fib(i)}');
print('fibonacci($i) = ${fibonacci(i)}'); //Uncomment this to try large numbers
}
/// Computes the nth Fibonacci number.
@isaacadariku
isaacadariku / main.dart
Created April 19, 2022 07:23
Balance Diets
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
@isaacadariku
isaacadariku / main.dart
Last active April 24, 2022 14:26
Grading system
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {