This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ✅ 1. Nested ternaries | |
| Widget _mainDisplay1( | |
| AsyncSnapshot<ValueNotifier<int>> snapshot, BuildContext context) => | |
| snapshot.hasData | |
| ? Column( | |
| mainAxisAlignment: MainAxisAlignment.center, | |
| children: <Widget>[ | |
| const Text( | |
| 'You have pushed the button this many times:', | |
| ), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'dart:math'; | |
| import 'package:flutter/material.dart'; | |
| import 'package:ioc_container/ioc_container.dart'; | |
| import 'dart:async'; | |
| import 'package:listenable_future_builder/listenable_future_builder.dart'; | |
| class User { | |
| final String id; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'dart:async'; | |
| import 'dart:math'; | |
| import 'package:flutter/foundation.dart'; | |
| import 'package:flutter/material.dart'; | |
| class ColorController extends Listenable { | |
| final List<VoidCallback> _listeners = []; | |
| Color _color = Colors.red; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:flutter/material.dart'; | |
| import 'dart:async'; | |
| import 'package:flutter/foundation.dart'; | |
| class TimerNotifier extends ChangeNotifier { | |
| Timer? _timer; | |
| int _seconds = 0; | |
| TimerNotifier() { | |
| _timer = Timer.periodic(const Duration(seconds: 1), (timer) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:flutter/material.dart'; | |
| import 'dart:async'; | |
| import 'package:flutter/foundation.dart'; | |
| void main() => runApp( | |
| MaterialApp( | |
| theme: ThemeData( | |
| useMaterial3: true, | |
| primarySwatch: Colors.purple, | |
| ), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'dart:async'; | |
| import 'package:flutter/foundation.dart'; | |
| import 'package:flutter/material.dart'; | |
| void main() { | |
| runApp( | |
| MaterialApp( | |
| theme: ThemeData( | |
| useMaterial3: true, | |
| primarySwatch: Colors.blue, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:flutter/material.dart'; | |
| void main() { | |
| runApp( | |
| MaterialApp( | |
| theme: ThemeData(useMaterial3: true), | |
| debugShowCheckedModeBanner: false, | |
| home: Scaffold( | |
| body: Center( | |
| child: Column( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:flutter/material.dart'; | |
| int hexToInteger(String hex) => int.parse(hex, radix: 16); | |
| extension StringColorExtensions on String { | |
| Color toColor() => Color(hexToInteger(this)); | |
| } | |
| void main() { | |
| runApp( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:flutter/material.dart'; | |
| void main() { | |
| runApp(const MyApp()); | |
| } | |
| class MyApp extends StatelessWidget { | |
| const MyApp({Key? key}) : super(key: key); | |
| @override |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //This is an ASP .NET Core Minimal API that receives SMS Web Hooks from Twilio | |
| using System.Text; | |
| using Twilio.AspNet.Core; | |
| using Twilio.TwiML; | |
| var builder = WebApplication.CreateBuilder(args); | |
| //Configure services | |
| builder.Services.AddSingleton<IReceiveSMS, ConsoleSMSReceiver>(); |