Skip to main content

adaptive_dimensions_flutter 0.0.5 copy "adaptive_dimensions_flutter: ^0.0.5" to clipboard
adaptive_dimensions_flutter: ^0.0.5 copied to clipboard

discontinuedreplaced by: design_sync

A flutter plugin for adapting different screen sizes, scaling Fonts on different screens.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'dart:async';

import 'package:flutter/services.dart';
import 'package:adaptive_dimensions_flutter/adaptive_dimensions_flutter.dart';

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
          appBar: AppBar(
            title: const Text('Example App'),
          ),
          body: MyHomePage()),
    );
  }
}

class MyHomePage extends StatelessWidget {
  final sampleText =
      "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.";

  @override
  Widget build(BuildContext context) {
    AdaptiveDimensions.init(context, 375, 812);

    return Column(
      children: <Widget>[
        Text(sampleText,
            overflow: TextOverflow.ellipsis,
            maxLines: 4,
            style: TextStyle(fontSize: 16, color: Colors.red)),
        Text(sampleText,
            overflow: TextOverflow.ellipsis,
            maxLines: 4,
            style: TextStyle(
                fontSize: AdaptiveDimensions.instance.size(16),
                color: Colors.black)),
        Text(sampleText,
            overflow: TextOverflow.ellipsis,
            maxLines: 4,
            style: TextStyle(
                fontSize: AdaptiveDimensions.instance.size(16, scale: false),
                color: Colors.deepPurple))
      ],
    );
  }
}
0
likes
40
points
61
downloads

Publisher

verified publisherdipendrasharma.com

Weekly Downloads

A flutter plugin for adapting different screen sizes, scaling Fonts on different screens.

Homepage

License

BSD-2-Clause (license)

Dependencies

flutter

More

Packages that depend on adaptive_dimensions_flutter

Packages that implement adaptive_dimensions_flutter