parent
8332933068
commit
0d247786f6
@ -0,0 +1,32 @@
|
|||||||
|
import 'package:ansu_ui/scaffold/as_scaffold.dart';
|
||||||
|
import 'package:example/common/code_view.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
class ExampleScaffold extends StatelessWidget {
|
||||||
|
final String title;
|
||||||
|
final CodeBuilder text;
|
||||||
|
final List<Widget> children;
|
||||||
|
const ExampleScaffold({
|
||||||
|
Key key,
|
||||||
|
@required this.title,
|
||||||
|
this.text,
|
||||||
|
@required this.children,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return ASScaffold(
|
||||||
|
title: title,
|
||||||
|
actions: [
|
||||||
|
text == null
|
||||||
|
? SizedBox()
|
||||||
|
: IconButton(
|
||||||
|
icon: Icon(Icons.code, color: Colors.black54),
|
||||||
|
onPressed: () => Get.to(CodeView(text: text)),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
body: ListView(children: children),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,45 @@
|
|||||||
|
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),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,35 @@
|
|||||||
|
import 'dart:io';
|
||||||
|
|
||||||
|
import 'package:ansu_ui/ansu_ui.dart';
|
||||||
|
import 'package:example/codeviewer/code_segments.dart';
|
||||||
|
import 'package:example/component/example_scaffold.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:velocity_x/velocity_x.dart';
|
||||||
|
|
||||||
|
class ExampleCameraView extends StatefulWidget {
|
||||||
|
ExampleCameraView({Key key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
_ExampleCameraViewState createState() => _ExampleCameraViewState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _ExampleCameraViewState extends State<ExampleCameraView> {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return ExampleScaffold(
|
||||||
|
title: 'Camera View',
|
||||||
|
text: (context) => CodeSegments.cameraView(context),
|
||||||
|
children: [
|
||||||
|
// BEGIN cameraView
|
||||||
|
ListTile(
|
||||||
|
title: 'CameraView'.text.make(),
|
||||||
|
onTap: () async {
|
||||||
|
File file = await camView(context, title: 'TEST');
|
||||||
|
print(await file.length());
|
||||||
|
},
|
||||||
|
),
|
||||||
|
// END
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue