自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

原创 Android面试总结

第一部分:Android部分Android基础知识 Android内存泄漏总结 Handler内存泄漏分析及解决 ListView详解 RecyclerView和ListView的异同 AsyncTask源码分析 插件化技术 自定义控件 Android绘制流程 Android动画机制 事件分发机制 ANR问题 Art和Da...

2020-07-15 01:42:11 860

转载 Flutter28.Android开发者的Flutter入门(二)

前言上篇文章Android开发者的Flutter入门(一)讲解了用Flutter开发一个简单的新闻app的大体流程以及主要功能的实现。其中略过了一些功能的实现细节。这篇文章会对这些细节做一些阐述。涉及到的有以下这些点:闪屏页自定义布局下拉刷新上拉加载更多使用Assets路由(页面跳转)内嵌WebView闪屏页由于启动Flutter app的时候需要初始化Flutter。这个时间是比较长的。所以开发Flutter app的时候都需要加一个闪屏页。给Android平台上跑的Flu

2020-07-22 01:41:46 31

转载 Flutter27.Android开发者的Flutter入门(一)

前言Flutter推出来已经有一段时间了,前一阵Google IO大会后发布了Beta3。基于Flutter的 app可以一次编写,同时在Android和iOS平台上跑,并且能给用户带来完全原生的体验。我们都知道跨平台开发还有Hybrid,React Native以及Weex等方案,这些解决方案都是从Web开发的角度向Native开发演进,其技术基础都是HTML、CSS和Javascript等Web技术,对于没有接触过Web开发的Native app程序员来讲,门槛是比较高的。而Flutter给我的感觉

2020-07-22 01:34:44 47

原创 Kotlin01.手指小球

activity_main.xml<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"xmlns:app="http://schemas.android.com/apk/res-auto"xmlns:tools="http://schemas.android.com/tools"android:layout_w

2020-07-22 01:19:43 45

原创 Flutter26.Animation5

ex:import 'dart:math';import 'package:flutter/material.dart';void main() => runApp(MyApp());class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( home: HomePage(), ); }}c

2020-06-28 02:06:10 50

原创 Flutter25.listview下拉刷新

eximport 'dart:math';import 'package:flutter/material.dart';void main() => runApp(MaterialApp( home: HomePage(),));class HomePage extends StatefulWidget { @override _HomePageState createState() => _HomePageState();}class _HomePageS

2020-06-28 01:38:32 75

原创 Flutter24.listView_3d

eximport 'dart:math';import 'package:flutter/material.dart';void main() => runApp(MaterialApp( home: HomePage(),));class HomePage extends StatefulWidget { @override _HomePageState createState() => _HomePageState();}class _HomePageS

2020-06-28 00:57:54 48

原创 Flutter23.flipper

ex:import 'dart:math';import 'package:flutter/material.dart';void main() => runApp(MaterialApp( home: HomePage(),));class HomePage extends StatefulWidget { @override _HomePageState createState() => _HomePageState();}class _HomePage

2020-06-28 00:33:49 40

原创 Flutter22.3d

ex:import 'package:flutter/material.dart';void main() => runApp(MaterialApp( home: HomePage(),));class HomePage extends StatefulWidget { @override _HomePageState createState() => _HomePageState();}class _HomePageState extends State&l

2020-06-27 23:48:09 39

原创 Flutter21.Animation4

ex:import 'package:flutter/material.dart';void main() => runApp(MaterialApp( home: HomePage(),));class HomePage extends StatefulWidget { @override _HomePageState createState() => _HomePageState();}class _HomePageState extends State&l

2020-06-27 01:45:06 67

原创 Flutter20.Animation3

ex:import 'package:flutter/material.dart';void main() => runApp(MaterialApp( home: HomePage(),));class HomePage extends StatefulWidget { @override _HomePageState createState() => _HomePageState();}class _HomePageState extends State&l

2020-06-27 01:16:57 44

原创 Flutter19.Animation2

ex:import 'package:flutter/material.dart';void main() => runApp(MaterialApp( home: HomePage(),));class HomePage extends StatefulWidget { @override _HomePageState createState() => _HomePageState();}class _HomePageState extends State&l

2020-06-27 01:02:06 34

原创 Flutter18.Animation1

ex:import 'package:flutter/material.dart';void main() => runApp(MaterialApp( home: HomePage(),));class HomePage extends StatefulWidget { @override _HomePageState createState() => _HomePageState();}class _HomePageState extends State&l

2020-06-27 00:40:36 39

原创 Flutter17.Dismissible

ex:import 'package:flutter/material.dart';void main() => runApp(MaterialApp( home: HomePage(),));class HomePage extends StatelessWidget { final List<String> items = List.generate(20, (index) => 'item $index'); @override Widget

2020-06-27 00:16:02 52

原创 Flutter16.GestureDetector

ex:import 'package:flutter/material.dart';void main() => runApp(MaterialApp( home: HomePage(),));class HomePage extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( body: Center( child

2020-06-27 00:02:26 27

原创 Flutter15.Table

ex:import 'package:flutter/material.dart';void main() => runApp(MaterialApp( home: HomePage(),));class HomePage extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( body: Center( child

2020-06-26 23:51:27 23

原创 Flutter14.Card

ex:import 'dart:math';import 'package:flutter/material.dart';void main() => runApp(MyApp());class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( title: 'CardApp', home: Hom

2020-06-26 19:30:18 48

原创 Flutter13.Dialog

ex:import 'dart:math';import 'package:flutter/material.dart';void main() => runApp(MyApp());class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( title: 'DialogApp', home: H

2020-06-26 18:10:57 137

原创 Flutter12.Drawer侧滑

ex,抽取方法快捷键Ctrl + Alt + M:import 'dart:math';import 'package:flutter/material.dart';void main() => runApp(MyApp());class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( title: 'Mat

2020-06-26 17:53:04 41

原创 Flutter11.Material

ex:import 'dart:math';import 'package:flutter/material.dart';void main() => runApp(MyApp());class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( title: 'MaterialApp', route

2020-06-26 17:33:40 39

原创 Flutter10.Form

ex:import 'package:flutter/material.dart';void main() => runApp(LoginPage());class LoginPage extends StatefulWidget { @override _LoginPageState createState() => _LoginPageState();}class _LoginPageState extends State<LoginPage> {

2020-06-26 02:03:10 39

原创 Flutter9.GridView

ex:import 'package:flutter/material.dart';void main() => runApp(MyApp());class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( home: Scaffold( appBar: AppBar(

2020-06-26 01:51:21 32

原创 Flutter8.listview

ex:import 'package:flutter/material.dart';void main() => runApp(MyApp());class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( home: Scaffold( appBar: AppBar( titl

2020-06-26 01:25:40 33

原创 Flutter7.button

ex:import 'package:flutter/material.dart';void main() => runApp(MyApp());class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( home: Scaffold( appBar: AppBar( titl

2020-06-26 01:07:26 30

原创 Flutter6:Text

ex:import 'package:flutter/gestures.dart';import 'package:flutter/material.dart';import 'package:flutter/rendering.dart';import 'package:url_launcher/url_launcher.dart';void main() => runApp(MyApp());class MyApp extends StatelessWidget {// d

2020-06-24 02:05:49 41

原创 Flutter6.加载图片,资源assets、pubspec、 图片

快捷键的使用stf StatefulWidget的快捷键 stl StatelessWidget的快捷键需要加载本地的图片首先需要找到pubspec.yaml 文件项目的静态资源,需要配置到根目录下的pubspec.yaml文件。 以静态图片为例子:1、在项目的根目录下创建images文件夹,放进一张图片。2、到 pubspec.yaml 配置一下 assets: - assets/im...

2020-06-23 02:13:15 192

原创 Flutter5.画图

main.dartimport 'dart:math';import 'package:flutter/material.dart';void main()=>runApp(MyApp());class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( home: Scaffold( appBa

2020-06-23 01:24:39 78

原创 Flutter4:树更新

视图树创建widget树。调用runApp(rootWidget),将rootWidget传给rootElement,做为rootElement的子节点,生成Element树,由Element树生成Render树,Render树的根是一个RenderView。Widget:存放渲染内容、视图布局信息,widget的属性最好都是immutable(如何更新数据呢?后续会讲到)。Element:存放上下文,通过Element遍历视图树,Element同时持有Widget和RenderObject。Re

2020-06-23 00:49:50 42

原创 Flutter3.Flutter默认demo

Flutter默认demo结构如下: main.dartimport 'package:flutter/material.dart';void main() { runApp(MyApp());}class MyApp extends StatelessWidget { // This widget is the root of your application. @override Widget bu...

2020-06-22 01:51:18 96

原创 Dart18.元数据(注解)-@deprecated

所有的 Dart 代码都可以使用: @deprecated 和 @override。mata1.dartimport 'todo.dart';main() { dynamic tv = new Television(); tv.activate(); tv.turnOn(); tv.turnOff(); tv.doSomething();}class Television { @deprecated void activate() { turnOn()

2020-06-22 00:52:50 74

原创 Dart17.递归生成器

yield* 以指针的方式传递递归对象,而不是整个同步对象。ex:void main(){ //递归生成器 //同步 var it1 = getSyncRecursiveGenerator(5).iterator; while (it1.moveNext()) { print(it1.current); } print('========================================'); //异步 getAsyncRecursiveGe

2020-06-22 00:47:27 51

原创 Dart16.同步生成器,异步生成器

使用sync*,返回的是Iterable对象。yield会返回moveNext为true,并等待 moveNext 指令。调用getSyncGenerator立即返回Iterable对象。调用moveNext方法时getSyncGenerator才开始执行。ex:generator.dartmain(){ var it = getSyncGenerator(5).iterator; while (it.moveNext()) { print(it.current); }

2020-06-22 00:35:08 56

原创 Dart15.异步-scheduleMicrotask()

ex:import 'dart:async';void main(){ testFuture();}void testScheduleMicrotask(){ scheduleMicrotask(() => print('s1')); new Future.delayed(new Duration(seconds: 1), () => print('s2')); new Future(() => print('s3')).then((_) { pri

2020-06-21 23:46:30 51

原创 Dart14:异步-Event Queue和Microtask Queue

Dart中有2中队列:Event Queue和Microtask Queue异步-Event Queue和Microtask Queue优先全部执行完Microtask Queue中的Event。 直到Microtask Queue为空时,才会执行Event Queue中的Event。 当Event Looper正在处理Microtask Queue中的Event时候,Event Queue中的Event就停止了处理了,此时App不能绘制任何图形,不能处理任何鼠标点击,不能处理文件IO等等。

2020-06-21 22:24:00 52

原创 Dart13.异步-then,catchError,whenComplete

ex:import 'dart:async';void main(){ new Future(() => futrueTask()) .then((i) => 'abc$i') .then((m) => print('$m')) .then((_) => new Future.error('出错了')) .whenComplete(() => print('whenComplete')) .catchE

2020-06-21 21:48:52 73

原创 Dart12.载入第三方库

1.修改pubspec.yaml文件,再点击pub getdependencies: flutter: sdk: flutter cupertino_icons: ^0.1.0 dio: ^2.1.0如下:2.调用lib.dart:import "package:dio/dio.dart";void main() { getHttp();}void getHttp() async { try { Response response =

2020-06-21 19:19:35 67

原创 Dart11.引入库

libraries.dart//import 'dart:math'; //载入核心库//import 'package:dio/dio.dart'; //载入第三方库//import 'mylib1.dart' as lib1; //载入文件//import 'mylib2.dart' as lib2; //如果两个库有冲突的标识符,可以为其中一个或两个库都指定前缀//import 'mylib1.dart' as lib1 show Test; //只载入库的某些部分//impor

2020-06-20 01:35:25 63

原创 Dart10.Mixin多继承

1.子类没有重写超类A方法的前提下,如果2个或多个超类拥有相同签名的A方法,那么子类会以继承的最后一个超类中的A方法为准。2.如果子类自己重写了A方法则以本身的A方法为准。Mixin.dartmain() { Bicycle().transport(); Motorcycle().transport(); Car().transport(); //四轮木制脚踏车 WoodenCar().transport();}//交通工具类,拥有运输功能abstract class

2020-06-20 01:33:27 49

原创 Dart9.构造函数

class.dartimport 'dart:math';main() { //普通构造函数 var p = new Point(1, 1); //new 可省略 var point = Point(1, 2); print(p); // 输出 Point(x = 1, y = 1) Point p1; print(p1.runtimeType); //可以使用Object类的runtimeType属性,获取对象的类型 此时的类型是null //命名构造函数 p

2020-06-18 01:51:43 71

原创 Dart8.Exception

exception.dartmain() { /// ---------------------------------异常的抛出throw-------------------------------- //抛出Exception对象// throw new FormatException('格式异常'); //抛出Error对象// throw new NullThrownError(); //抛出任意非null对象// throw '这是一个异常'; ///

2020-06-18 01:51:01 53

提示
确定要删除当前文章?
取消 删除