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/material.dart'; | |
import 'package:flutter_bloc/flutter_bloc.dart'; | |
void main() { | |
runApp(MyApp()); | |
} | |
//WIDGETS |
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
// 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 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'; | |
//TODO: реализовать hero анимацию при выборе элемента | |
final urls = [ | |
'https://www.thecocktaildb.com/images/media/drink/rrtssw1472668972.jpg', | |
'https://www.thecocktaildb.com/images/media/drink/xtuyqv1472669026.jpg', | |
'https://www.thecocktaildb.com/images/media/drink/wwpyvr1461919316.jpg', | |
'https://www.thecocktaildb.com/images/media/drink/ywxwqs1461867097.jpg', | |
'https://www.thecocktaildb.com/images/media/drink/vqyxqx1472669095.jpg', |
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( | |
home: CustomRouteSample(), | |
)); | |
} | |
class CustomRouteSample extends StatelessWidget { | |
@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
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(MaterialApp( | |
home: RootScreen(), | |
)); | |
} | |
class RootScreen extends StatefulWidget { | |
@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
// MaterialPageRoute( | |
// builder: (context) => ..., | |
// settings: RouteSettings(arguments: ...,name: ...)) | |
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(MaterialApp( | |
onGenerateRoute: (settings) { | |
//todo реализовать открытие TitlePage |
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
// MaterialPageRoute( | |
// builder: (context) => ..., | |
// settings: RouteSettings(arguments: ...,name: ...)) | |
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(MaterialApp( | |
onGenerateRoute: (settings) { | |
//todo реализовать открытие TitlePage |
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
Future<void> main() async { | |
final future1 = Future.delayed(Duration(milliseconds: 100)).then((value) => throw 'error'); | |
final future2 = future1.then((value) {}).catchError((e){ | |
print('future2 error: ${e}'); | |
}); | |
final future3 = future2.then((value) {},onError: (e){ | |
print('future3 onError: ${e}'); | |
}).catchError((e){ | |
print('future3 error: ${e}'); |
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( | |
home: ClipSamplePage(), | |
)); | |
class ClipSamplePage extends StatefulWidget { | |
@override | |
_ClipSamplePageState createState() => _ClipSamplePageState(); |
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:collection'; | |
void main() { | |
// при использовании growable мы только запрещаем операции которые влияют на размер списка. | |
// но нам все так же доступна операция set | |
final nonGrowableList = [1,2,3].toList(growable:false); | |
nonGrowableList[0] = 4; | |
//nonGrowableList.remove(0);// - будет ошибка |
NewerOlder