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
| analyzer: | |
| exclude: | |
| - "**/*.g.dart" | |
| - "**/*.freezed.dart" | |
| linter: | |
| rules: | |
| - always_declare_return_types | |
| - always_require_non_null_named_parameters | |
| - annotate_overrides |
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
| image: debian:latest | |
| stages: | |
| - build | |
| cache: | |
| untracked: true | |
| key: "$CI_BUILD_REF_NAME" | |
| paths: |
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
| main() { | |
| final _numbers = List<int>() | |
| ..add(1) | |
| ..add(2) | |
| ..add(3); | |
| print(_numbers); | |
| } | |
| /**************************** |
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(LazyGridViewApp()); | |
| } | |
| class LazyGridViewApp extends StatelessWidget { | |
| final _list = List.generate(42, (index) => index); | |
| @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(LazyGridViewApp()); | |
| } | |
| class LazyGridViewApp extends StatelessWidget { | |
| @override | |
| Widget build(BuildContext context) { | |
| return MaterialApp( |
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
| return new Scaffold( | |
| appBar: new AppBar( | |
| title: new Text("Project Details"), | |
| backgroundColor: Colors.blue[800]), | |
| body: | |
| new CustomScrollView( | |
| slivers: <Widget>[ | |
| new SliverPadding(padding: const EdgeInsets.only(left: 10.0,right: 10.0, | |
| top: 10.0,bottom: 0.0), | |
| sliver: new SliverList(delegate: |
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 'dart:math'; | |
| void main() { | |
| runApp(MyApp()); | |
| } | |
| class MyApp extends StatelessWidget { | |
| // This widget is the root of your application. |
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
| void _setupScrollController() { | |
| _scrollController = ScrollController(); | |
| _scrollController.addListener(_scrollListener); | |
| } | |
| void _scrollListener() { | |
| if (_scrollController.offset >= | |
| _scrollController.position.maxScrollExtent) { | |
| _page++; |
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
| int _page = 1; | |
| int _limit = 10; | |
| ScrollController _scrollController; | |
| @override | |
| void initState() { | |
| _setupScrollController(); | |
| _fetch(); |
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
| _fetch() { | |
| _http.get('/posts?_start=$_page&_limit=$_limit') | |
| .then((response) { | |
| final _fetchedPosts = (response.data as List) | |
| .map((_user) => { | |
| 'id': _user['id'], | |
| 'title': _user['title'], | |
| 'body': 'body', | |
| }) | |
| .toList(); |