flutter_screen_adaptation 0.0.2 copy "flutter_screen_adaptation: ^0.0.2" to clipboard
flutter_screen_adaptation: ^0.0.2 copied to clipboard

Flutter screen adaptation plugin.

Flutter屏幕适配插件 #

用法 #

import 'package:flutter/material.dart';

import 'package:flutter_screen_adaptation/flutter_screen_adaptation.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await ScreenAdaptation.init(800, 600);
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {

  @override
  void initState() {
    super.initState();
  }


  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Container(width: 400.wdp, height:300.hdp,color: Colors.green,),
        ),
      ),
    );
  }
}

1
likes
115
pub points
0%
popularity

Publisher

unverified uploader

Flutter screen adaptation plugin.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

unknown (license)

Dependencies

flutter

More

Packages that depend on flutter_screen_adaptation