面试准备
layout: post title: “2019-12-16-面试准备.markdown” date: 2019-12-16 12:11:30 +0800
通俗+干货
- flutter各层的简单介绍
- dart特点介绍
语法
.. 操作符/空指针优化 可以native运行; with,mixin,on; extension on; assert // assert 在生产模式无效 构造函数
优化使用
单接口优先使用Function 函数也是对象可以通过typeDef简化 Function 优于 dynamic PREFER inline function types over typedefs. DO override hashCode if you override == // the default behavior for == is identity, // Any two objects that are equal must have the same hash code. // Otherwise, maps and other hash-based collections // will fail to recognize that the two objects are equivalent 语言特性
线程设计
提几个重要的 Effective Dart
AVOID defining a one-member abstract class when a simple function will do.
AVOID defining a class that contains only static members.
AVOID type annotating initialized local variables
// 多使用var
List<List<Ingredient>> possibleDesserts(Set<Ingredient> pantry) {
var desserts = <List<Ingredient>>[]; // var one
for (var recipe in cookbook) { // var two
if (pantry.containsAll(recipe)) {
desserts.add(recipe);
}
}
return desserts;
}
https://dart.dev/guides/language/effective-dart/design#do-use-terms-consistently
- android启动等知识和最近版本更新 recycleView模仿