Skip to content

Instantly share code, notes, and snippets.

View slightfoot's full-sized avatar
💙
Fluttering

Simon Lightfoot slightfoot

💙
Fluttering
View GitHub Profile
@slightfoot
slightfoot / humpday_2025-04-23_1.dart
Created April 23, 2025 19:26
Localizations and deferred loading - by Simon Lightfoot :: #HumpdayQandA on 23rd April 2025 :: https://www.youtube.com/watch?v=XRuKywXD7zM
// MIT License
//
// Copyright (c) 2025 Simon Lightfoot
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@slightfoot
slightfoot / humpday_2025-04-16_3.dart
Created April 16, 2025 20:10
Reverse List Example - by Simon Lightfoot :: #HumpdayQandA on 16th April 2025 :: https://www.youtube.com/watch?v=CgiIh96C2DI
// MIT License
//
// Copyright (c) 2025 Simon Lightfoot
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@slightfoot
slightfoot / humpday_2025-04-16_1.dart
Created April 16, 2025 20:09
Cancellable Futures Example - by Simon Lightfoot :: #HumpdayQandA on 16th April 2025 :: https://www.youtube.com/watch?v=CgiIh96C2DI
// MIT License
//
// Copyright (c) 2025 Simon Lightfoot
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@slightfoot
slightfoot / humpday_2025-04-09-mock.dart
Created April 9, 2025 17:58
Mocking with noSuchMethod - by Simon Lightfoot :: #HumpdayQandA on 9th April 2025 :: https://www.youtube.com/watch?v=LddUVHziMaM
// MIT License
//
// Copyright (c) 2025 Simon Lightfoot
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@slightfoot
slightfoot / humpday_2025-04-02_1.dart
Created April 2, 2025 16:46
Intrinsic Height PageView Example - by Simon Lightfoot :: #HumpdayQandA on 2nd April 2025 :: https://www.youtube.com/watch?v=U-XV0kZjI8Q
// MIT License
//
// Copyright (c) 2025 Simon Lightfoot
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@slightfoot
slightfoot / contacts_form_example.dart
Created March 26, 2025 20:15
Contacts Form Example - by SImon Lightfoot :: #HumpdayQandA on 26th March 2025 :: https://www.youtube.com/watch?v=HVMXJTxEDnw
// MIT License
//
// Copyright (c) 2025 Simon Lightfoot
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@slightfoot
slightfoot / drawing_area.dart
Last active March 22, 2025 00:27
Drawing Area Example - by Simon Lightfoot :: 21/03/2025
// MIT License
//
// Copyright (c) 2025 Simon Lightfoot
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:

Stumbled upon this, the code at the bottom compiles, but there is no output, when I was thinking it might output something like >> list 123, 456

Was looking for a shorthand to

final cb = callback;
if (cb != null) {
  cb(['123','456']);
}
String intToString(int value) {
final chars = <int>[];
while (value > 0) {
// 0x30 == ASCII '0'
chars.add(0x30 + (value % 10));
value ~/= 10;
}
return String.fromCharCodes(chars.reversed);
}
@slightfoot
slightfoot / humpday_2025-02-26_soloman.dart
Last active February 26, 2025 20:31 — forked from Slozzyondul/screenTransition.dart
Wizard State Management - by Simon Lightfoot :: #HumpdayQandA on 26th February 2025 :: https://www.youtube.com/watch?v=wn_g2Z6RaZ8
// MIT License
//
// Copyright (c) 2025 Simon Lightfoot
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions: