You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.0 KiB
46 lines
1.0 KiB
4 years ago
|
import 'package:example/extension/example_num_ext.dart';
|
||
|
import 'package:example/util_view/example_camera_view.dart';
|
||
|
import 'package:flutter/material.dart';
|
||
|
import 'package:get/get.dart';
|
||
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||
|
|
||
|
class MainUtils extends StatefulWidget {
|
||
|
MainUtils({Key key}) : super(key: key);
|
||
|
|
||
|
@override
|
||
|
_MainUtilsState createState() => _MainUtilsState();
|
||
|
}
|
||
|
|
||
|
class _MainUtilsState extends State<MainUtils> {
|
||
|
_innerButton({
|
||
|
VoidCallback onPressed,
|
||
|
Widget child,
|
||
|
Widget icon,
|
||
|
}) {
|
||
|
return TextButton(
|
||
|
onPressed: onPressed,
|
||
|
child: Row(
|
||
|
children: [
|
||
|
Expanded(child: icon ?? SizedBox()),
|
||
|
child,
|
||
|
Spacer(),
|
||
|
],
|
||
|
),
|
||
|
);
|
||
|
}
|
||
|
|
||
|
@override
|
||
|
Widget build(BuildContext context) {
|
||
|
return ListView(
|
||
|
padding: EdgeInsets.all(16.w),
|
||
|
children: [
|
||
|
_innerButton(
|
||
|
onPressed: () => Get.to(ExampleCameraView()),
|
||
|
child: Text('CAMERA'),
|
||
|
icon: Icon(Icons.camera),
|
||
|
),
|
||
|
],
|
||
|
);
|
||
|
}
|
||
|
}
|