This file contains 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 'package:flutter/services.dart'; | |
const kGap = SizedBox(height: 40); | |
void main() { | |
runApp(const MyApp()); | |
} | |
class MyApp extends StatelessWidget { |
This file contains 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
const String _endpoint1BusyKey = 'endpoint1Busy'; | |
const String _endpoint2BusyKey = 'endpoint2Busy'; | |
const String _endpoint3BusyKey = 'endpoint3Busy'; | |
const String _endpoint4BusyKey = 'endpoint4Busy'; | |
const String _endpoint5BusyKey = 'endpoint5Busy'; | |
class EndpointViewmodel extends BaseViewModel { | |
final _endpointService = EndpointService(); | |
// Values of the busy state of the endpoints. |
This file contains 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
// Let's have two creature classes, | |
// each of them with their own set of behaviours. | |
// The obvious solution would be to directly outline the methods | |
// for each class as we need them ... | |
class Alligator { | |
void swim() => print('Swimming'); | |
void bite() => print('Biting'); | |
void hunt() { |
This file contains 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
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file | |
// for details. All rights reserved. Use of this source code is governed by a | |
// BSD-style license that can be found in the LICENSE file. | |
import 'package:flutter/material.dart'; | |
import 'package:flutter/services.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { |
This file contains 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
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file | |
// for details. All rights reserved. Use of this source code is governed by a | |
// BSD-style license that can be found in the LICENSE file. | |
import 'package:flutter/material.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override |
This file contains 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
void main() { | |
int i = 150; | |
final fib = fibonacciWithDynamicProgramming(); | |
print('fibonacciWithDynamicProgramming($i) = ${fib(i)}'); | |
print('fibonacci($i) = ${fibonacci(i)}'); //Uncomment this to try large numbers | |
} | |
/// Computes the nth Fibonacci number. |
This file contains 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(Amenities()); | |
} | |
class CheckContainerModel { | |
final String title; | |
bool isCheck; |
This file contains 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(Amenties()); | |
} | |
class CheckContainer extends StatefulWidget { | |
const CheckContainer({Key? key, this.title = ''}) : super(key: key); | |
final String title; |
This file contains 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
void main() { | |
// Generate List of numbers | |
List numbers = List<int>.generate(20, (index) => index); | |
int length = numbers.length; | |
int split = 2; | |
List chunks = []; | |
for (int i = 0; i < length; i += split) { | |
var end = (i + split < length) ? i + split : length; |
This file contains 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' as math; | |
void main() { | |
final Circle c1 = Circle.all(color: 'blue', radius: 2.0); | |
c1.getRadius(); | |
c1.getColor(); | |
c1.getArea(); | |
final Circle c2 = Circle.radius(radius: 2.0); | |
c2.getRadius(); |