npay_component 0.1.9 copy "npay_component: ^0.1.9" to clipboard
npay_component: ^0.1.9 copied to clipboard

outdated

A new Flutter package.

example/lib/main.dart

import 'package:example/tabbar_example.dart';
import 'package:flutter/material.dart';
import 'package:npay_component/styles/font_scale.dart';
import 'package:npay_component/components/button_widget/np_button.dart';
import 'package:npay_component/components/np_dialog_widget/np_dialog.dart';

void main() {
  RatioScreenApp.setRatio(1.0);
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'NPComponent Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(title: 'NPComponent'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);
  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  final ctr1 = TextEditingController();
  final ctr2 = TextEditingController();
  final ctr3 = TextEditingController();
  final _scaffoldKey = GlobalKey<ScaffoldState>();
  String errorT = '';
  String errorT2 = '';
  String test =
      'Bên bờ Đại Tây Dương, đất nước Ghana với nhiều những khu vực nghèo đói vẫn có thể sản sinh ra nhân tài. Người ta gọi cậu Kelvin là Elon Musk của Ghana là hoàn toàn có lý do: từ thuở nhỏ, Kelvin đã mò mẫm chế tạo robot, đồ chơi công nghệ và thậm chí cả máy hút bụi! ';
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.yellowAccent,
      appBar: AppBar(
        title: Text(widget.title),
        automaticallyImplyLeading: false,
      ),
      key: _scaffoldKey,
      body: ListView(
        children: [
          Container(
            height: 10,
          ),
          Text(test).regular20(),
          Container(
            height: 10,
          ),
          Text(test).regular18(),
          Container(
            height: 10,
          ),
          Text(test).regular16(),
          Container(
            height: 10,
          ),
          Text(test).tag16(),
          Container(
            height: 10,
          ),
          Text(test).tag14(),
          Container(
            height: 10,
          ),
          Text(test).tag12(),
          Container(
            height: 10,
          ),
          NPButton.primary(
              isActive: true,
              colorText: Colors.white,
              title: 'NPButtonPrimary',
              onPressed: () {
                showDialog(
                    context: context,
                    builder: (ctx) {
                      return NpDialog(
                        title: 'Thoát tài khoản',
                        content: 'Bạn có chắc chắn muốn thoát tài khoản không?',
                        textBtnWhite: 'Đồng ý',
                        textBtnGreen: 'Không',
                      );
                    });
              }),
          Container(
            height: 100,
          ),
          NPButton.secondary(
              colorText: Color(0xFF15AE62),
              isActive: true,
              title: 'NPButtonSecondary',
              onPressed: () => print('NPButtonSecondary')),
          Container(
            height: 100,
          ),
          TextButton(
              onPressed: () {
                Navigator.of(context).push(
                    MaterialPageRoute(builder: (context) => TabBarExample()));
              },
              child: Container(
                child: Text('tabbar'),
              ))
        ],
      ),
    );
  }
}
0
likes
30
pub points
50%
popularity

Publisher

unverified uploader

A new Flutter package.

License

MIT (LICENSE)

Dependencies

flutter, flutter_styled_toast, flutter_svg

More

Packages that depend on npay_component