Skip to content

Instantly share code, notes, and snippets.

View ufe-pr's full-sized avatar

Ufedojo Atabo ufe-pr

View GitHub Profile
@ufe-pr
ufe-pr / nudged_border.dart
Created November 25, 2021 13:45
A simple custom input border
import 'package:flutter/material.dart';
const darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
@ufe-pr
ufe-pr / main.dart
Last active May 13, 2021 03:16
Splash animation
import 'package:flutter/material.dart';
import 'dart:math' as math;
void main() {
runApp(MyApp());
}
class MyApp extends MaterialApp {
MyApp() : super(home: SplashPage());
}
@ufe-pr
ufe-pr / bouncing_balls_anim.dart
Last active September 11, 2021 02:52
A simple loading animation with flutter
import 'package:flutter/material.dart';
import 'dart:math' as math;
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
import 'package:flutter/material.dart';
import 'dart:collection' show SplayTreeMap;
import 'dart:math' show Random;
final Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
import 'dart:math';
import 'package:flutter/material.dart';
final Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
import 'package:flutter/material.dart';
final Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
@ufe-pr
ufe-pr / main.dart
Created May 7, 2020 02:03
30 days of code day 6
void main() {
search('t', '');
}
search(String keyword, String text) {
// Since there's always an empty string in every string
// I didn't include checking if the text is an empty string since it
// should print not matched in that case.
if (keyword == '') {
print('Matched!');
@ufe-pr
ufe-pr / main.dart
Created May 5, 2020 21:57
30 days of code day 5
void main() {
// Testing goes here
for (int i = 0; i <= 9; i++) {
print('There are ${totalWays(i)} ways for $i boy(s).');
}
}
int factorial(int n) {
@ufe-pr
ufe-pr / main.dart
Created May 4, 2020 23:44
30 days of code day 4 mobile intermediate
import 'package:flutter/material.dart';
// Note: This is not responsive, doesn't look well on big screens
void main() {
runApp(MyApp());
}
List<String> cats = ['General', 'Medicine','Tech', 'Sports'];
@ufe-pr
ufe-pr / main.dart
Created May 4, 2020 22:22
30 days of code day 4
void main() {
// Add test cases here
print(countCases('A boy went To SchooL'));
}
Map<String, int> countCases(String string) {
// The string of alphabets
String letters = 'abcdefghijklmnopqrstuvwxyz';
// Lists of uppercase and lowercase letters