add screenutil support

null_safety
小赖 4 years ago
parent 73b546c493
commit 41b1baedc3

@ -1,3 +1,4 @@
import 'package:ansu_ui/ansu_ui.dart';
import 'package:ansu_ui/buttons/as_button.dart'; import 'package:ansu_ui/buttons/as_button.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -6,9 +7,10 @@ void main() {
} }
class MyApp extends StatelessWidget { class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ScreenUtil.init(context,
designSize: Size(750, 1334), allowFontScaling: false);
return MaterialApp( return MaterialApp(
title: 'Flutter Demo', title: 'Flutter Demo',
theme: ThemeData( theme: ThemeData(
@ -60,6 +62,7 @@ class _MyHomePageState extends State<MyHomePage> {
body: ListView( body: ListView(
children: [ children: [
ASButton(), ASButton(),
SizedBox(height: 12.w),
], ],
), ),
); );

@ -69,6 +69,13 @@ packages:
description: flutter description: flutter
source: sdk source: sdk
version: "0.0.0" version: "0.0.0"
flutter_screenutil:
dependency: transitive
description:
name: flutter_screenutil
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.2.0"
flutter_test: flutter_test:
dependency: "direct dev" dependency: "direct dev"
description: flutter description: flutter

@ -1,3 +1,4 @@
library ansu_ui; library ansu_ui;
export 'buttons/as_button.dart'; export 'buttons/as_button.dart';
export 'package:flutter_screenutil/flutter_screenutil.dart';

@ -55,6 +55,13 @@ packages:
description: flutter description: flutter
source: sdk source: sdk
version: "0.0.0" version: "0.0.0"
flutter_screenutil:
dependency: "direct main"
description:
name: flutter_screenutil
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.2.0"
flutter_test: flutter_test:
dependency: "direct dev" dependency: "direct dev"
description: flutter description: flutter

@ -2,7 +2,6 @@ name: ansu_ui
description: A new Flutter package. description: A new Flutter package.
version: 0.0.1 version: 0.0.1
author: author:
homepage:
environment: environment:
sdk: ">=2.7.0 <3.0.0" sdk: ">=2.7.0 <3.0.0"
@ -11,6 +10,7 @@ environment:
dependencies: dependencies:
flutter: flutter:
sdk: flutter sdk: flutter
flutter_screenutil: ^3.2.0
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
@ -21,7 +21,6 @@ dev_dependencies:
# The following section is specific to Flutter. # The following section is specific to Flutter.
flutter: flutter:
# To add assets to your package, add an assets section, like this: # To add assets to your package, add an assets section, like this:
# assets: # assets:
# - images/a_dot_burr.jpeg # - images/a_dot_burr.jpeg
@ -32,7 +31,6 @@ flutter:
# #
# An image asset can refer to one or more resolution-specific "variants", see # An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware. # https://flutter.dev/assets-and-images/#resolution-aware.
# To add custom fonts to your package, add a fonts section here, # To add custom fonts to your package, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a # in this "flutter" section. Each entry in this list should have a
# "family" key with the font family name, and a "fonts" key with a # "family" key with the font family name, and a "fonts" key with a

Loading…
Cancel
Save