https://github.com/UESTC-BBS/API-Docs/wiki/Mobcent-API
flutter build apk --obfuscate --split-debug-info=HLQ_Struggle --target-platform android-arm,android-arm64,android-x64 --split-per-abi
git fetch
flutter build apk --obfuscate --split-debug-info=HLQ_Struggle --target-platform android-arm,android-arm64,android-x64 --split-per-abi
adb install build/app/outputs/flutter-apk/app-armeabi-v7a-release.apk
adb install build/app/outputs/flutter-apk/app-arm64-v8a-release.apk
adb -s adb-56ca1081-vP9WNP._adb-tls-connect._tcp. kill-server
adb -s 192.168.28.39:42163 install app-armeabi-v7a-release.apk
adb install build/app/outputs/flutter-apk/app-armeabi-v7a-release.apk
flutter build ios --release
flutter run --no-null-safety
flutter build macOS --release
https://zhuanlan.zhihu.com/p/56864296
https://www.cnblogs.com/silentdoer/p/15041143.html
{
"id": 123, // 本地缓存的草稿ID
"poll": ["1", "2", "3"], // 投票信息
"column_id": 0, // 板块ID
"column_child_id": 0, // 子板块ID
"type": 0, // 0-普通, 1-二手专区, 2-密语区, 3-图文
"body": [ // 信息
{
"type": "image",
"cont": "https://bbs.uestc.edu.cn/..."
},
{
"type": "txt",
"cont": "blabla..."
}
]
}
> main.dart
MultiProvider(
providers: [
ChangeNotifierProvider(
create: (context) => MainProvider(),
),
]
)
> provider.dart
class MainProvider extends ChangeNotifier {
int curNum = 0;
add() {
curNum++;
notifyListeners();
}
minus() {
curNum--;
notifyListeners();
}
}
> ele.dart
KeyBoard provider = Provider.of<KeyBoard>(context);
> main.dart
MaterialApp(
initialRoute: "/",
onGenerateRoute: (settings) {
final Function cotrollerFn = routers[settings.name];
//判断访问不存在的路由地址
if (cotrollerFn == null) {
return CupertinoPageRoute(
builder: (context) => routers['/404'](),
);
}
if (settings.arguments == null) {
return CupertinoPageRoute(
builder: (context) => cotrollerFn(),
);
} else {
return CupertinoPageRoute(
builder: (context) => cotrollerFn(settings.arguments),
);
}
},
onUnknownRoute: (setting) {
return CupertinoPageRoute(
builder: (context) => routers["/404"](),
);
},
),
> router.dart
final routers = {
"/": () => Home(),
"/broke": () => Broke(),
"/me": () => Me(),
"/search": () => OSSearch(),
"/myhome": () => MyHome(),
"/square": () => Square(),
"/404": () => Page404(),
};
> ele.dart
Navigator.pushNamed(context, "/square");
> pubspec.yaml
assets:
- lib/img/logo.svg
> svg.dart
SvgPicture.asset(
'lib/img/logo.svg',
width: 40,
height: 40,
)
myInkWell(
widget: GestureDetector(
onTap: () {
print("object");
},
child: Container(
child: Text("水波纹"),
),
),
color: os_black_opa,
splashColor: os_black_opa,
width: 100,
height: 100,
radius: 10,
)
AnnotatedRegion<SystemUiOverlayStyle>(
value: SystemUiOverlayStyle.dark,
child: Container()
)
if (Platform.isAndroid) {
SystemChrome.setSystemUIOverlayStyle(
SystemUiOverlayStyle(statusBarColor: Colors.transparent));
}
MediaQuery.of(context).size.width
{
"infor": "https://bbs.uestc.edu.cn/data/attachment/forum/202201/17/232224senjq9cjyiqqnyq6.jpg",
"type": 1, // 0-纯文字 1-图片 4-链接 5-附件
"url": "https://bbs.uestc.edu.cn/forum.php?mod=attachment&aid=MjEwNTQxOHw0OWY4ZDM5YnwxNjQ0MDcyNjY0fDIyMTc4OHwxOTE3OTc0",
"desc": "(7.88 MB, 下载次数: 352)",
"originalInfo": "https://bbs.uestc.edu.cn/data/attachment/forum/202201/17/232224senjq9cjyiqqnyq6.jpg",
"aid": 2105419
}
ScrollController _scrollController = new ScrollController();
_scrollController.addListener(() {
if (_scrollController.position.pixels ==
_scrollController.position.maxScrollExtent) {
_getComment();
}
});
bool vibrate = false;
if (_scrollController.position.pixels < -100) {
if (!vibrate) {
vibrate = true; //不允许再震动
Vibrate.feedback(FeedbackType.impact);
}
}
if (_scrollController.position.pixels >= 0) {
vibrate = false; //允许震动
}
AnimationController controller; //动画控制器
Animation<double> animation;
double _right = -200;
@override
void initState() {
super.initState();
widget.controller.addListener(() {
if (widget.show) {
controller.forward();
} else {
controller.reverse();
}
});
controller = new AnimationController(
vsync: this,
duration: Duration(milliseconds: 400),
)..addListener(() {
setState(() {});
});
final CurvedAnimation curve = CurvedAnimation(
parent: controller,
curve: Curves.easeInOut,
);
animation = Tween(begin: -200.0, end: 20.0).animate(curve)
..addListener(() {
setState(() {
_right = animation.value;
});
});
}
RefreshIndicator(
color: os_color,
onRefresh: () async {
var data = await _getInitData();
vibrate = false;
return data;
},
child: _buildComponents(),
);
bool showBackToTop = false;
ScrollController _controller = new ScrollController();
if (_controller.position.pixels > 1000 && !showBackToTop) {
setState(() {
showBackToTop = true;
});
}
if (_controller.position.pixels < 1000 && showBackToTop) {
setState(() {
showBackToTop = false;
});
}
https://bbs.uestc.edu.cn/forum.php?mod=post&action=edit&tid=1943353&pid=34122687