Skip to content

Instantly share code, notes, and snippets.

View lesliearkorful's full-sized avatar
🏠
Working from home

Leslie Arkorful lesliearkorful

🏠
Working from home
View GitHub Profile
@lesliearkorful
lesliearkorful / rowOffsetHeight.dart
Last active July 27, 2020 20:18
Pin-point the offset height of an item in a 3-width grid
void main() {
int listLength = 24;
int index = 5;
int h = (listLength * 66) ~/ 3;
int col = index % 3;
print('find index: $index');
print('gridHeight: $h');
print('rows : ${h / 66}');
print('column : ${col + 1}');
print('row height: ${((((index - 1) * 66) / 3) + 88) - (col * 22)}');
[
"Ashanti",
"Bono",
"Bono East",
"Brong Ahafo",
"Central",
"Eastern",
"Greater Accra",
"North East",
"Northern",
{
"Ashanti": [
"Adansi Akrofurom District Assembly",
"Adansi North District",
"Adansi South District",
"Afigya Kwabre North District Assembly",
"Afigya-Kwabre District",
"Ahafo Ano North District",
"Ahafo Ano South District",
"Ahafo Ano South East District Assembly",
import 'package:flutter/cupertino.dart' show showCupertinoModalPopup;
import 'package:flutter/material.dart';
class _NumberPad extends StatefulWidget {
final int value;
final ValueWidgetBuilder<int> headerBuilder;
final ValueChanged<int> onChanged;
_NumberPad({this.headerBuilder, this.onChanged, this.value});
@override
extension PhoneNumberExtension on String {
String get toGHPhoneNumber {
if (this.length != 10) return this;
return '${this.substring(0, 3)} ${this.substring(3, 6)} ${this.substring(6, 10)}';
}
}
import 'dart:async';
import 'package:flutter/material.dart';
final Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@lesliearkorful
lesliearkorful / mapstyle.json
Last active February 23, 2020 18:51
Google Maps Style (Uber-inspired)
[
{
"elementType": "geometry",
"stylers": [
{
"color": "#e7e9ec"
},
{
"visibility": "on"
}
class Login extends StatefulWidget {
@override
_LoginState createState() => _LoginState();
}
class _LoginState extends State<Login> {
InputDecoration inputDecoration({Icon icon, Icon sicon, String hintText}) {
return InputDecoration(
prefixIcon: icon,
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(