0
votes

i try to run on devices

code:

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



// ignore: camel_case_types
class profileScreen extends StatefulWidget {
profileScreen({Key key}) : super(key: key);

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

// ignore: camel_case_types
class _profileScreen extends State<profileScreen> {

@override
Widget build(BuildContext context) {

return Scaffold(
    body: profileView()
);
}

Widget profileView() {
return Column(
  children: <Widget>[
    Padding(
      padding: EdgeInsets.fromLTRB(30, 50, 30, 30),
      child: Row(
        mainAxisAlignment: 
    MainAxisAlignment.spaceBetween,
        children: <Widget>[
          Container(height: 50, width: 50 ,child: 
    Icon(Icons.arrow_back_ios, size: 24,color: 
   Colors.black54,), decoration: 
   BoxDecoration(border: Border.all(color: 
   Colors.black54), borderRadius: 
   BorderRadius.all(Radius.circular(10))),),
          Text('Profiles details', style: 
   TextStyle(fontSize: 18, fontWeight: 
  FontWeight.bold),),
          Container(height: 24,width: 24)
        ],
      ),
    ),
    Padding(
      padding: const EdgeInsets.fromLTRB(0, 0,0 ,50),
      child: Stack(
        children: <Widget>[
          CircleAvatar(
            radius: 70,
            child: ClipOval(child: Image.asset('', height: 150, width: 150, fit: BoxFit.cover,),),
          ),
          Positioned(bottom: 1, right: 1 ,child: Container(
            height: 40, width: 40,
            child: Icon(Icons.add_a_photo, color: Colors.deepOrange,),
            decoration: BoxDecoration(
                color: Colors.deepOrange,
                borderRadius: BorderRadius.all(Radius.circular(20))
            ),
          ))
        ],
      ),
    ),
    Expanded(child: Container(
      decoration: BoxDecoration(
          borderRadius: BorderRadius.only(topLeft: Radius.circular(30), topRight: Radius.circular(30)),
          gradient: LinearGradient(
              begin: Alignment.topRight,
              end: Alignment.bottomLeft,
              colors: [Colors.black54, Color.fromRGBO(0, 41, 102, 1)]
          )
      ),
      child: Column(
        children: <Widget>[
          Padding(
            padding: const EdgeInsets.fromLTRB(20, 25, 20, 4),
            child: Container(
              height: 60,
              child: Align(
                alignment: Alignment.centerLeft,
                child: Padding(
                  padding: const EdgeInsets.all(8.0),
                  child: Text('Name', style: TextStyle(color: Colors.white70),),
                ),
              ), decoration: BoxDecoration(borderRadius: BorderRadius.all(Radius.circular(20)),border: Border.all(width: 1.0, color: Colors.white70)),
            ),
          ),
          Padding(
            padding: const EdgeInsets.fromLTRB(20, 5, 20, 4),
            child: Container(
              height: 60,
              child: Align(
                alignment: Alignment.centerLeft,
                child: Padding(
                  padding: const EdgeInsets.all(8.0),
                  child: Text('Email', style: TextStyle(color: Colors.white70),),
                ),
              ), decoration: BoxDecoration(borderRadius: BorderRadius.all(Radius.circular(20)),border: Border.all(width: 1.0, color: Colors.white70)),
            ),
          ),
          Padding(
            padding: const EdgeInsets.fromLTRB(20, 5, 20, 4),
            child: Container(
              height: 60,
              child: Align(
                alignment: Alignment.centerLeft,
                child: Padding(
                  padding: const EdgeInsets.all(8.0),
                  child: Text('Type something about yourself', style: TextStyle(color: Colors.white70),),
                ),
              ), decoration: BoxDecoration(borderRadius: BorderRadius.all(Radius.circular(20)),border: Border.all(width: 1.0, color: Colors.white70)),
            ),
          ),
          Padding(
            padding: const EdgeInsets.fromLTRB(20, 5, 20, 4),
            child: Container(
              height: 60,
              child: Align(
                alignment: Alignment.centerLeft,
                child: Padding(
                  padding: const EdgeInsets.all(8.0),
                  child: Text('Phone number', style: TextStyle(color: Colors.white70),),
                ),
              ), decoration: BoxDecoration(borderRadius: BorderRadius.all(Radius.circular(20)),border: Border.all(width: 1.0, color: Colors.white70)),
            ),
          ),
          Expanded(
            child: Align(
              alignment: Alignment.bottomRight,
              child: Container( height: 70, width: 200,
                child: Align(child: Text('Save', style: TextStyle(color: Colors.white70, fontSize: 20),),),
                decoration: BoxDecoration(
                    color: Colors.deepOrange,
                    borderRadius: BorderRadius.only(topLeft: Radius.circular(30),)
                ),
              ),
            ),
          )
        ],
      ),
    ))
  ],
);
 }
   }

Exception caught by widgets library The following assertion was thrown building Builder(dirty): A build function returned null.

The offending widget is: Builder Build functions must never return null.

To return an empty space that causes the building widget to fill available room, return "Container()". To return an empty space that takes as little room as possible, return "Container(width: 0.0, height: 0.0)".

The relevant error-causing widget was: MaterialApp file:///C:/Users/PC-Admin/Desktop/faceadmin/lib/main.dart:15:12 When the exception was thrown, this was the stack: #0 debugWidgetBuilderValue. (package:flutter/src/widgets/debug.dart:302:7) #1 debugWidgetBuilderValue (package:flutter/src/widgets/debug.dart:323:4) #2 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4632:7) #3 Element.rebuild (package:flutter/src/widgets/framework.dart:4343:5) #4 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4606:5)

1
there might another error, check the first error in the consoleYadu

1 Answers

0
votes

The snippet worked for me. The only problem I think might be the formatting/indentation or something up with flutter. Try running flutter clean and then running the project.