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
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 {
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 '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
{
"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",
[
"Ashanti",
"Bono",
"Bono East",
"Brong Ahafo",
"Central",
"Eastern",
"Greater Accra",
"North East",
"Northern",
@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)}');