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 / responsive_page.dart
Created September 6, 2023 18:34
Response Page - by Simon Lightfoot - Humpday Q&A - 6th September 2023
// MIT License
//
// Copyright (c) 2023 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 / segment_selector.dart
Last active August 12, 2023 18:45
Segment Selector - by Simon Lightfoot - 9th August 2023 - Humpday Q&A - https://twitter.com/BrandoTrautmann/status/1688517737591545857
// MIT License
//
// Copyright (c) 2023 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 / focus_ring.dart
Created August 9, 2023 18:07
Focus Ring - by Simon Lightfoot - 9th August 2023 - Humpday Q&A
// MIT License
//
// Copyright (c) 2023 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 / loyalty_cards.dart
Last active July 30, 2023 23:09
Example of extensions on functions - by Simon Lightfoot - 21st July 2023
// Output:
// type 'int' is not a subtype of type 'String' in type cast
// [LoyaltyCardData{1}, null, LoyaltyCardData{3}]
Future<void> main() async {
print(await cards().first);
}
Stream<List<LoyaltyCardData?>> cards() async* {
final data = <Map<String, dynamic>>[
@slightfoot
slightfoot / sliver_magic.dart
Last active April 17, 2024 16:25
Sliver Magic - by Simon Lightfoot - #HumpdayQandA - 19th July 2023 - #Flutter #Dart - https://www.youtube.com/live/zNOZD0JSFQY?feature=share&t=7315
// MIT License
//
// Copyright (c) 2023 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 / main.dart
Last active June 3, 2023 15:07
Flip Cards Example - 17th May 2023 & 24th May 2023 & 31st May 2023 - HumpdayQandA (Incomplete) - by Simon Lightfoot
// MIT License
//
// Copyright (c) 2023 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 / infinite_calendar.dart
Last active April 13, 2023 14:39
Infinite Calendar - by Simon Lightfoot - 12/04/2023 #HumpdayQandA
// MIT License
//
// Copyright (c) 2023 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 / child_builder.dart
Created April 5, 2023 20:41
Single Child Builder Widget - by Simon Lightfoot - 05/04/2023
// MIT License
//
// Copyright (c) 2023 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 / bottom_nav_page_transition.dart
Created March 22, 2023 18:47
Example of bottom navigation with custom page transitions during HumpdayQ&A - 22nd March 2023
// MIT License
//
// Copyright (c) 2023 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 / profile_avatar.dart
Created January 18, 2023 20:53
Resizey Profile Avatar Thing for #HumpDayQandA - 18/01/2023 - by Simon Lightfoot
// MIT License
//
// Copyright (c) 2023 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: