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(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
title: 'MMR Calculator', | |
home: null, |
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
name: flutter_app | |
description: Flutter app to calculator your MMR percentile | |
version: 1.0.0+1 | |
environment: | |
sdk: ">=2.1.0 <3.0.0" | |
dependencies: | |
flutter: |
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(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
// I'm building a material app so using the MaterialApp widget gives us access to all of Flutter's material widgets | |
return MaterialApp( | |
// Implements the basic material design visual layout structure |
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
class InputPage extends StatefulWidget { | |
@override | |
_InputPageState createState() => _InputPageState(); | |
} | |
class _InputPageState extends State<InputPage> { | |
// Initialise isError bool variable to false. Used to change style of TextField widget if the user enters a value which isn't allowed. | |
bool _isError = false; | |
@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
import 'package:flutter/material.dart'; | |
const double kVerticalMargin = 16; | |
const double kHorizontalMargin = 22; | |
const double kSizedBoxHeight = 20; | |
const TextStyle kButtonTextStyle = TextStyle( | |
fontSize: 16, | |
); | |
const TextStyle kPrimaryTextStyle = TextStyle( | |
fontSize: 32, |
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
class ResultsPage extends StatefulWidget { | |
@override | |
_ResultsPageState createState() => _ResultsPageState(); | |
} | |
class _ResultsPageState extends State<ResultsPage> { | |
@override | |
Widget build(BuildContext context) { | |
return Container( | |
margin: EdgeInsets.symmetric( |
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'; | |
const double kVerticalMargin = 16; | |
const double kHorizontalMargin = 22; | |
const double kSizedBoxHeight = 20; | |
const TextStyle kButtonTextStyle = TextStyle( | |
fontSize: 16, | |
color: Color(0xffFEFEFE), | |
); | |
const TextStyle kAppBarTextStyle = TextStyle( |
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/widgets.dart'; | |
import 'constants.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
// I'm building a material app so using the MaterialApp widget gives us access to all of Flutter's material widgets |
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 'constants.dart'; | |
import 'package:http/http.dart' as http; | |
const String kURL = 'https://api.opendota.com/api/distributions/'; | |
class Brain { | |
Future<dynamic> getCumulativeCount() async { | |
http.Response response = await http.get('$kURL?apikey=$kAPIKey'); | |
print(response.body); | |
} |
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 'constants.dart'; | |
import 'package:http/http.dart' as http; | |
import 'dart:convert'; | |
class Brain { | |
Future<dynamic> getCumulativeCount({int userMMR}) async { | |
http.Response response = await http.get('$kURL?apikey=$kAPIKey'); | |
if (response.statusCode == 200) { | |
String responseData = response.body; | |
int mmrResponse = |
OlderNewer